Repository navigation
fix(tui): keep reset transitions isolated from stale input - #116873
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 5:12 PM ET / 21:12 UTC. ClawSweeper reviewWhat this changesThe branch makes Merge readinessThis PR remains necessary: current Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s terminal UI turns editor input into commands or chat submissions while maintaining the selected agent session. This code sits between editor submission, backend session mutation, history/session refreshes, and the rendered terminal transcript. flowchart LR
A[Editor input] --> B[Submit burst handler]
B --> C[Session transition boundary]
C --> D{Admission decision}
D -->|allowed| E[Chat submission]
D -->|blocked| F[Restore editor draft]
E --> G[Session and history refresh]
G --> H[Rendered terminal UI]
Decision needed
Why: The implementation is source-audited and proof-positive, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource +151, Tests +395. Total +546 across 17 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one canonical transition owner in the TUI command handler, preserve blocked drafts at the editor boundary, and land the repair after the owning reviewer accepts the bounded session-state risk on the current merge result. Do we have a high-confidence way to reproduce the issue? Yes, by source: hold Is this the best way to solve the issue? Yes. Centralizing transition ownership where AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e73250f54baf. 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
HistoryReview history (5 earlier review cycles)
|
e6713fc to
f6d560d
Compare
|
@clawsweeper re-review The final head now includes inspectable real-PTY proof requested by the review. Run 30644166554 records |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
f6d560d to
081e660
Compare
|
@clawsweeper re-review The PR body now contains the final exact-head real-PTY transcript, focused proof, rebased scoped-gate evidence, and final review results for |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (22 commits) fix(cron): preserve lazy ownership and bounded notification lifetimes (#117018) fix: live updater no-op restarts healthy gateways (#117038) fix(bedrock): release streaming clients (#117039) fix(google): restore canonical Gemini and Vertex provider invariants (#117042) fix(channels): preserve accepted LINE and Mattermost delivery (#117024) fix(feishu): unify truthful delivery and media ownership (#117023) fix(ui): isolate gateway observer lifecycles (#117017) fix(tui): keep reset transitions isolated from stale input (#116873) fix(gateway): centralize streamed media descriptor ownership (#117000) feat(plugins): externalize OpenCode provider (#117035) fix(onboarding): restore skill dependency consent (#116644) fix(streaming): preserve incomplete bracket tails in final replies (#116983) fix: allow slower gateway readiness after updates (#117032) fix(plugin-state): avoid shared SQLite corruption when CLI starts during gateway runtime (#113204) fix(cli): keep config file output raw under JSON logging (#116968) fix(ai): malformed Anthropic stream frames expose raw event payloads (#116938) fix(qa): authenticate actual scenario execution evidence (#117004) feat(plugins): externalize NovitaAI provider (#117007) fix(text): preserve fenced tool markers in visible-text sanitizer (#116939) (#116971) fix(channels): reset metadata memos with plugin lifecycle (#117005) ...
…116873) * fix(tui): fence reset session transitions * fix(tui): explain blocked reset input * test(tui): isolate reset transition PTY proof * fix(tui): preserve input across session transitions * test(tui): synchronize preserved reset draft proof * test(tui): control reset submit timing * test(tui): close reset PTY with EOF * test(tui): exit reset PTY without submit buffering * test(tui): synchronize reset PTY shutdown * test(tui): widen reset PTY exit window * test(tui): stabilize reset transition PTY proof * test(tui): keep reset PTY harness bounded * test(tui): split reset PTY fixture wiring
What Problem This Solves
Fixes a TUI race where
/resetcould be rolled back by a slow pre-reset history or session-info read, while prompts entered during the transition could be lost, sent to the retiring session, or overwrite a newer draft.Why This Change Was Made
/newand/resetnow share one canonical session-transition owner. Every submit captures the transition epoch at Enter; delayed burst flushes use that snapshot rather than live state. A blocked submit is restored ahead of any newer editor draft, and replacement-session commit advances the existing history/session-info generations before adopting the replacement identity. No parallel compatibility epoch or fallback path was added.User Impact
Input typed while
/resetis pending remains visible and is preserved with text typed after Enter. Once reset completes, the combined draft can be sent exactly once to the replacement session. Slow pre-reset reads cannot repaint or restore the retired session./exitand/quitremain available during the transition.Evidence
081e6603f4be48fe0fe475a8d4c57a1f744fd953.oxfmtlookup was unavailable on Testbox PATH; the pinned repository formatter check passed locally on the exact files.git diff --check: passed.Release-note context: TUI session reset now preserves overlapping input and ignores stale pre-reset history/session reads.