Skip to content

fix(native-chat): retire separator-glued pending sends - #14406

Closed
erishforG wants to merge 1 commit into
stablyai:mainfrom
erishforG:fix/14262-native-chat-glued-echo
Closed

erishforG wants to merge 1 commit into
stablyai:mainfrom
erishforG:fix/14262-native-chat-glued-echo

Conversation

@erishforG

@erishforG erishforG commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When two rapidly sent prompts become one transcript line, Native Chat should remove both temporary queued bubbles. It previously handled only prompts joined with no separator, so a retained space could leave both bubbles stuck below newer replies forever.

What Changed

  • Match glued pending sends with or without one normalized whitespace separator at each send boundary.
  • Keep exact full-text matching so unrelated prefixes do not retire pending sends.
  • Added coverage for retained separators, mixed separator boundaries, repeated prompts, and partial-prefix rejection.

Why

The send path preserves the raw trailing space on the PTY, while pending-text normalization trims it. A rapid second send can therefore produce a transcript row such as tell me a joke continue, but the old matcher only tried tell me a jokecontinue. Since transcript matching is the retirement path for successful optimistic sends, both queued echoes remained pinned.

Prior Work

#14263 addressed the same separator-glued defect, but its author closed it after determining that the broader drift they were investigating had a separate queued_command cause. The closing comment explicitly left #14262 open as a standalone report. This PR carries that standalone fix forward with additional mixed-boundary, repeated-prompt, and prefix-rejection coverage.

Linked Issue

Fixes #14262

Visual Proof

N/A — this fixes renderer reconciliation state. The deterministic string-level regression reproduces the same transcript and pending-send state without requiring a timing-dependent live agent race.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

Verified on macOS with Node 24.18.0:

  • pnpm lint — passed
  • pnpm typecheck — passed
  • pnpm test — passed
  • pnpm build — passed
  • focused pending reconciliation tests — 53 passed
  • focused oxlint and oxfmt checks — passed
  • git diff --check — passed

The full suite used the isolated Orca contribution environment: OpenClaw CODEX variables unset, TMPDIR=/tmp, umask 0027, and ORCA_CROSS_VERSION_BASELINE_REF=v1.4.180.

AI Disclosure

OpenAI Codex GPT-5 was used to verify the issue against current main, implement the bounded matcher change, add regression and boundary tests, and review the diff. All commands above were run locally and the final diff was manually reviewed.

Review

  • Security: no authentication, secret handling, command execution, or permission behavior changed.
  • Cross-platform: the matcher is platform-independent pure renderer string logic.
  • SSH/remote: reconciliation consumes normalized transcript text identically for local and remote sessions.
  • Backwards compatibility: separator-less glue and exact single-send occurrence matching retain their existing behavior.
  • Performance: pending sends are capped at eight. Candidate prefixes are pruned at every boundary and exact matching remains bounded by that cache.
  • Correctness boundaries: mixed separators and repeated prompts match; incomplete longer transcript prefixes do not.

Checklist

  • This PR is small and focused
  • I explained what changed and why including ELI5
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered or N/A
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass or CI will cover; local preferred

All four commands were executed locally and passed.

Author

  • X / Twitter: N/A

## ELI5

When two rapidly sent prompts become one transcript line, Native Chat should remove both temporary queued bubbles. It previously handled only prompts joined with no separator, so a retained space could leave both bubbles stuck below newer replies forever.

## What Changed

- Match glued pending sends with or without one normalized whitespace separator at each send boundary.
- Keep exact full-text matching so unrelated prefixes do not retire pending sends.
- Added coverage for retained separators, mixed separator boundaries, repeated prompts, and partial-prefix rejection.

## Why

The send path preserves the raw trailing space on the PTY, while pending-text normalization trims it. A rapid second send can therefore produce a transcript row such as tell me a joke continue, but the old matcher only tried tell me a jokecontinue. Since transcript matching is the retirement path for successful optimistic sends, both queued echoes remained pinned.

## Linked Issue

Fixes stablyai#14262

## Visual Proof

N/A — this fixes renderer reconciliation state. The deterministic string-level regression reproduces the same transcript and pending-send state without requiring a timing-dependent live agent race.

## Testing

- [x] I manually tested these changes locally
- [x] Automated tests added/updated, or explained why not below

Verified on macOS with Node 24.18.0:

- pnpm lint — passed
- pnpm typecheck — passed
- pnpm test — passed
- pnpm build — passed
- focused pending reconciliation tests — 53 passed
- focused oxlint and oxfmt checks — passed
- git diff --check — passed

The full suite used the isolated Orca contribution environment: OpenClaw CODEX variables unset, TMPDIR=/tmp, umask 0027, and ORCA_CROSS_VERSION_BASELINE_REF=v1.4.180.

## AI Disclosure

OpenAI Codex GPT-5 was used to verify the issue against current main, implement the bounded matcher change, add regression and boundary tests, and review the diff. All commands above were run locally and the final diff was manually reviewed.

## Review

- Security: no authentication, secret handling, command execution, or permission behavior changed.
- Cross-platform: the matcher is platform-independent pure renderer string logic.
- SSH/remote: reconciliation consumes normalized transcript text identically for local and remote sessions.
- Backwards compatibility: separator-less glue and exact single-send occurrence matching retain their existing behavior.
- Performance: pending sends are capped at eight. Candidate prefixes are pruned at every boundary and exact matching remains bounded by that cache.
- Correctness boundaries: mixed separators and repeated prompts match; incomplete longer transcript prefixes do not.

## Checklist

- [x] This PR is small and focused
- [x] I explained what changed and why including ELI5
- [x] Before/after screenshots or videos attached for UI changes, or N/A with reason
- [x] Self-reviewed for correctness, security, and performance
- [x] Cross-platform, SSH/remote, and path/shortcut impact considered or N/A
- [x] pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass or CI will cover; local preferred

All four commands were executed locally and passed.

## Author

- X / Twitter: N/A
@coderabbitai

coderabbitai Bot commented Aug 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d97bba40-34fe-49fa-b3ba-056b3c40d5d2

📥 Commits

Reviewing files that changed from the base of the PR and between 0a0ae97 and 4906321.

📒 Files selected for processing (2)
  • src/renderer/src/components/native-chat/native-chat-pending-occurrence.ts
  • src/renderer/src/components/native-chat/native-chat-pending.test.ts

📝 Walkthrough

Walkthrough

The pending text matcher now supports direct concatenation and single-space separators between pending sends. It tracks candidate combinations while validating transcript prefixes and returns a count only for exact matches. Regression tests cover whitespace-separated sends, mixed separators, repeated prompts, and transcript text that extends beyond the combined pending text.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The matcher and regression tests address issue #14262 by retiring pending sends for separator-glued transcript turns while preserving exact matching.
Out of Scope Changes check ✅ Passed The changes are limited to the pending-send matcher and focused regression tests described by issue #14262.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly and concisely describes the main Native Chat reconciliation fix for separator-glued pending sends.
Description check ✅ Passed The description covers the required sections, linked issue, rationale, testing, visual proof, AI disclosure, review considerations, and checklist.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@erishforG

Copy link
Copy Markdown
Contributor Author

Superseded by #14663, which preserves this fix and adds the send-boundary protection needed to avoid matching older transcript rows. Thanks for carrying this through and for the attribution.

@erishforG erishforG closed this Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Native chat stale "queued" bubbles pin below the newest reply after a separator-glued rapid send

3 participants