Repository navigation
fix(tui): preserve legitimate consecutive backspaces - #117989
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 9:10 AM ET / 13:10 UTC. ClawSweeper reviewWhat this changesThis PR preserves repeated terminal Backspace input by deduplicating only adjacent mixed ASCII Backspace/Delete encodings that represent one legacy SSH keypress. Merge readinessKeep 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 Review scores
Verification
How this fits togetherThe 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]
Decision needed
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
Agent review detailsSecurityNone. PR surfaceSource +2, Tests +115. Total +117 across 3 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest 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 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 AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2de2fa3d673e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* 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
Co-authored-by: Peter Steinberger <[email protected]>
* 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
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 sendsainstead of silently sendingab. Existing mixed-encoding SSH duplicate handling remains intact.Evidence
1c602449e6fd8e81278744d90da06def5fac17e8; unchanged parent:5739f42c48775e22b8463d94d4faf4486b11232b.61 62 63 7f 7f 0dand the actual backend observed the wrong submitted messageab.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"}gpt-5.6-sol/ high-reasoning review was explicitly run with--max-priority P3and found zero actionable findings; the real TruffleHog scanner is clean.Agent Transcript
Agent-assisted implementation was independently reviewed by four fresh hostile source reviewers, audited against the actual pinned
@earendil-works/pi-tuiimplementation, 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
1c602449e6fd8e81278744d90da06def5fac17e8has a successful requiredopenclaw/ci-gate: https://github.com/openclaw/openclaw/actions/runs/30749189673/job/91500741451.@earendil-works/pi-tuisource:node_modules/@earendil-works/pi-tui/dist/keys.js:532defines the Windows-Terminal-versus-SSH distinction, and:729–:751implements Backspace/Ctrl+Backspace matching. The focused tests cover both dependency branches.origin/mainis 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.