Skip to content

fix(tui): preserve legitimate consecutive backspaces - #117989

Merged
steipete merged 1 commit into
mainfrom
codex/auto-qa-tui-backspace-5739
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/auto-qa-tui-backspace-5739

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes the terminal UI silently discarding legitimate consecutive Backspace keystrokes when terminal input arrives in one burst. The previous global eight-millisecond filter suppressed every subsequent Backspace, even when users actually pressed Backspace twice.

Why This Change Was Made

Keep legacy SSH protection in its existing owner while narrowing it to the one real duplicate pattern: adjacent complementary ASCII Backspace/Delete encodings for a single keypress. Preserve identical repeated bytes, intervening input, bracketed paste, Kitty keyboard events, and the upstream Windows Terminal versus SSH modifier distinction; make the regression tests independent of the host's ambient terminal environment.

User Impact

Typing abc, pressing Backspace twice, and submitting now sends a instead of silently sending ab. Existing mixed-encoding SSH duplicate handling remains intact.

Evidence

  • Exact reviewed head: 1c602449e6fd8e81278744d90da06def5fac17e8; unchanged parent: 5739f42c48775e22b8463d94d4faf4486b11232b.
  • Genuine unchanged-parent RED: 7 failed / 77 passed in the focused owner suite, plus one actual OS pseudo-terminal failure. A real PTY received bytes 61 62 63 7f 7f 0d and the actual backend observed the wrong submitted message ab.
  • Exact-head GREEN: 84/84 focused unit tests passed; the same real OS PTY, same raw input bytes, and same backend observed the correct submitted message a (1/1 targeted PTY passed). Targeted type-aware lint and formatting passed for all three files. Authentic exact-parent PTY RED and exact-head PTY GREEN.
{"head":"1c602449e6fd8e81278744d90da06def5fac17e8","parent":"5739f42c48775e22b8463d94d4faf4486b11232b","parentRed":{"unit":{"failed":7,"passed":77},"realPty":{"failed":1},"rawInputHex":"6162637f7f0d","observedBackendMessage":"ab"},"candidateGreen":{"unit":{"passed":84},"realPty":{"passed":1,"skipped":51},"rawInputHex":"6162637f7f0d","observedBackendMessage":"a","controls":["complementary legacy encoding dedupe","same-byte repeated backspace","ASCII backspace","Kitty repeat/release","intervening printable/paste","Windows SSH/session isolation"]},"scopedTypeAwareOxlint":"passed","scopedFormat":"passed"}
  • Four genuinely fresh independent complete-owner reviews identified no candidate-introduced P0–P3 findings. One review separately noted an already-existing Windows editor Ctrl+Backspace binding gap outside this deduper; this patch correctly preserves that event and does not change editor bindings.
  • The official gpt-5.6-sol / high-reasoning review was explicitly run with --max-priority P3 and found zero actionable findings; the real TruffleHog scanner is clean.
  • Production delta: 11 additions / 9 deletions = +2 lines; no configuration, provider, authentication, persistence, public API, or protocol changes.

Agent Transcript

Agent-assisted implementation was independently reviewed by four fresh hostile source reviewers, audited against the actual pinned @earendil-works/pi-tui implementation, reviewed with explicit P0–P3 Sol/high plus real TruffleHog, and proven using an actual OS pseudo-terminal against both immutable parent and exact candidate. No credentials or private chain-of-thought are included.

Maintainer Decision and Current Gates

  • Explicit repository-owner authorization: land this independently proved, low-risk owner-boundary repair; the protected maintainer label is intentional.
  • Exact candidate 1c602449e6fd8e81278744d90da06def5fac17e8 has a successful required openclaw/ci-gate: https://github.com/openclaw/openclaw/actions/runs/30749189673/job/91500741451.
  • Direct dependency inspection completed against the installed pinned @earendil-works/pi-tui source: node_modules/@earendil-works/pi-tui/dist/keys.js:532 defines the Windows-Terminal-versus-SSH distinction, and :729–:751 implements Backspace/Ctrl+Backspace matching. The focused tests cover both dependency branches.
  • Current origin/main is a descendant of the reviewed parent and has no changes in any of the three touched TUI files. Rebasing would replace the exact already-reviewed, exact-head-green commit without improving overlap safety; merge the reviewed candidate unchanged.
  • ClawSweeper's prior merge-risk notes referred to checks that were still running and unavailable dependency files at its review time; both gaps are now closed by the exact-head green gate and direct pinned-dependency inspection above.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 2, 2026
@steipete
steipete marked this pull request as ready for review August 2, 2026 13:05
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 9:10 AM ET / 13:10 UTC.

ClawSweeper review

What this changes

This PR preserves repeated terminal Backspace input by deduplicating only adjacent mixed ASCII Backspace/Delete encodings that represent one legacy SSH keypress.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for protected-label human review. Current main still suppresses any second Backspace inside eight milliseconds, while the branch narrows suppression to adjacent, differently encoded legacy Backspace bytes and adds unit plus PTY coverage; final exact-head checks and dependency-contract confirmation remain appropriate before merge.

Priority: P1
Reviewed head: 1c602449e6fd8e81278744d90da06def5fac17e8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong focused PTY proof and a small owner-boundary repair support the patch; exact-head refresh and direct dependency-contract review remain the material confidence reducers.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The PR body provides exact parent-red and head-green real OS pseudo-terminal evidence for the raw input sequence, and the supplied check state marks real-behavior proof successful; redact-sensitive artifacts remain appropriate if reposted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The PR body provides exact parent-red and head-green real OS pseudo-terminal evidence for the raw input sequence, and the supplied check state marks real-behavior proof successful; redact-sensitive artifacts remain appropriate if reposted.
Evidence reviewed 6 items Current-main defect: Current main records only a timestamp, so every Backspace recognized within the eight-millisecond window is discarded regardless of whether it is an actual repeat or a complementary legacy encoding.
Patch owner-boundary repair: The PR retains deduplication at the existing terminal-input listener boundary but records the previous byte and suppresses only a timely, differently encoded pair; equal bytes remain editor input.
Regression coverage: The branch covers same-byte DEL and ASCII-BS repeats, intervening printable and paste input, repeated complementary pairs, Windows Terminal behavior, SSH behavior, and the actual PTY submission path.
Findings None None.
Security None None.

How this fits together

The terminal UI receives raw key input through its TUI listener before the editor applies edits and submits a chat message to the selected backend. This small deduper sits at that input boundary, where it must suppress one legacy transport duplicate without dropping intentional repeated keys.

flowchart LR
  A[Terminal input bytes] --> B[TUI input listener]
  B --> C[Backspace deduper]
  C --> D[Terminal editor]
  D --> E[Submitted chat message]
  C --> F[Suppress mixed legacy duplicate]
  C --> G[Keep intentional repeats]
Loading

Decision needed

Question Recommendation
Should this protected maintainer-labeled TUI fix be rebased and approved once the exact-head required checks complete? Rebase and approve: Refresh the branch onto current main, confirm the exact-head checks and dependency behavior, then merge the narrowly scoped fix.

Why: The source and supplied PTY evidence support the repair, but the protected label requires explicit human handling and the local review could not inspect the pinned dependency contract directly.

Before merge

  • Resolve merge risk (P1) - The branch is behind current main and several supplied check runs were still in progress; refresh or rebase and require exact-head green gates before merging.
  • Resolve merge risk (P1) - This review could not directly inspect the pinned @earendil-works/pi-tui matchesKey implementation because dependencies were absent and network access failed; the PR's type/proof checks mitigate but do not replace that contract check.
  • Complete next step (P2) - The protected maintainer label and incomplete exact-head checks require explicit human merge review rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Source +2, Tests +115. Total +117 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 11 9 +2
Tests 2 127 12 +115
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 138 21 +117

Review metrics

None.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Keep the narrow input-boundary state machine, refresh it against current main, and merge only after the exact head preserves both real repeated Backspaces and legacy mixed-encoding SSH suppression.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Keep the narrow input-boundary state machine, refresh it against current main, and merge only after the exact head preserves both real repeated Backspaces and legacy mixed-encoding SSH suppression.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the failure: current main suppresses any recognized second Backspace within eight milliseconds. The supplied branch proof additionally reports a parent-red and candidate-green OS PTY run for abc followed by two DEL bytes.

Is this the best way to solve the issue?

Yes, conditionally: preserving the existing deduper owner and distinguishing only adjacent complementary legacy encodings is narrower and safer than removing deduplication. A final direct check of the pinned matchesKey dependency contract is still warranted.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2de2fa3d673e.

Labels

Label changes:

  • add P1: Current terminal UI input can silently discard intentional repeated Backspaces, producing incorrect submitted text for active TUI users.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact parent-red and head-green real OS pseudo-terminal evidence for the raw input sequence, and the supplied check state marks real-behavior proof successful; redact-sensitive artifacts remain appropriate if reposted.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body provides exact parent-red and head-green real OS pseudo-terminal evidence for the raw input sequence, and the supplied check state marks real-behavior proof successful; redact-sensitive artifacts remain appropriate if reposted.

Label justifications:

  • P1: Current terminal UI input can silently discard intentional repeated Backspaces, producing incorrect submitted text for active TUI users.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The PR body provides exact parent-red and head-green real OS pseudo-terminal evidence for the raw input sequence, and the supplied check state marks real-behavior proof successful; redact-sensitive artifacts remain appropriate if reposted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides exact parent-red and head-green real OS pseudo-terminal evidence for the raw input sequence, and the supplied check state marks real-behavior proof successful; redact-sensitive artifacts remain appropriate if reposted.

Evidence

What I checked:

  • Current-main defect: Current main records only a timestamp, so every Backspace recognized within the eight-millisecond window is discarded regardless of whether it is an actual repeat or a complementary legacy encoding. (src/tui/tui.ts:259, 2de2fa3d673e)
  • Patch owner-boundary repair: The PR retains deduplication at the existing terminal-input listener boundary but records the previous byte and suppresses only a timely, differently encoded pair; equal bytes remain editor input. (src/tui/tui.ts:258, 1c602449e6fd)
  • Regression coverage: The branch covers same-byte DEL and ASCII-BS repeats, intervening printable and paste input, repeated complementary pairs, Windows Terminal behavior, SSH behavior, and the actual PTY submission path. (src/tui/tui.test.ts:397, 1c602449e6fd)
  • Feature provenance: The current deduper originates in the recent QA evidence consolidation commit; the patch author also has the strongest recent history across the affected TUI files, including the runtime-ownership refactor. (src/tui/tui.ts:259, 652b0b96e20d)
  • Proof and validation evidence: The PR body provides exact parent-versus-head focused-suite and OS-PTY results, and the supplied check state reports successful real-behavior proof, production types, lint, and security gates. The linked workflow artifact could not be fetched from this environment. (src/tui/tui-pty-harness.e2e.test.ts:345, 1c602449e6fd)
  • Dependency-contract gap: The repository has no installed @earendil-works/pi-tui source, and network resolution failed, so this review could not directly inspect the pinned matchesKey contract behind the changed string-key call. (package.json:1947, 2de2fa3d673e)

Likely related people:

  • steipete: Has the strongest sampled history on the affected TUI files and authored recent TUI runtime ownership and session-mode work; this PR also follows that established input-owner path. (role: recent TUI area contributor; confidence: high; commits: d876a8338722, 08ea9cc31d8e, 1c602449e6fd; files: src/tui/tui.ts, src/tui/tui.test.ts, src/tui/tui-pty-harness.e2e.test.ts)
  • Dallin Romney: The current-main timestamp-only deduper lines trace to the commit that introduced this code path. (role: introduced current behavior; confidence: high; commits: 652b0b96e20d; files: src/tui/tui.ts, src/tui/tui.test.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase or refresh against current main and wait for all exact-head required checks to finish.
  • Verify the pinned @earendil-works/pi-tui matchesKey contract before approval.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 3748fcf into main Aug 2, 2026
192 of 201 checks passed
@steipete
steipete deleted the codex/auto-qa-tui-backspace-5739 branch August 2, 2026 13:28
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 2, 2026
* origin/main:
  fix(ui): label Gateway connection settings for accessibility (#118000)
  ci(qa): extend profile evidence timeout (#117999)
  fix(googlechat): report a blocked account instead of a webhook path that was never bound (#117986)
  fix(line): preserve semantic indentation in fenced code (#117996)
  fix(plugins): contain rejected synchronous hook results (#117988)
  fix(cli): preserve shell profiles when completion install fails (#117987)
  fix(tui): preserve legitimate consecutive backspaces (#117989)
  fix: preserve queued messages during /compact (#117840)
  fix(talk): enforce relay lifecycle bounds
  fix(talk): enforce relay terminal precedence
  test(talk): cover relay tool-call retention overflow
  fix(talk): bound relay tool-call lifecycle state
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* origin/main:
  fix(ui): label Gateway connection settings for accessibility (openclaw#118000)
  ci(qa): extend profile evidence timeout (openclaw#117999)
  fix(googlechat): report a blocked account instead of a webhook path that was never bound (openclaw#117986)
  fix(line): preserve semantic indentation in fenced code (openclaw#117996)
  fix(plugins): contain rejected synchronous hook results (openclaw#117988)
  fix(cli): preserve shell profiles when completion install fails (openclaw#117987)
  fix(tui): preserve legitimate consecutive backspaces (openclaw#117989)
  fix: preserve queued messages during /compact (openclaw#117840)
  fix(talk): enforce relay lifecycle bounds
  fix(talk): enforce relay terminal precedence
  test(talk): cover relay tool-call retention overflow
  fix(talk): bound relay tool-call lifecycle state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant