Repository navigation
fix(tui): handle live session message updates - #96252
harjothkhara wants to merge 7 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 7, 2026, 3:00 AM ET / 07:00 UTC. Summary PR surface: Source +92, Tests +317. Total +409 across 7 files. Reproducibility: yes. at source level: current main broadcasts displayable transcript appends as Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Land the narrow TUI Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main broadcasts displayable transcript appends as Is this the best way to solve the issue? Yes, this is the narrow owner-boundary fix because it consumes the existing Gateway event contract in TUI without adding protocol, config, provider, or plugin surface. It is not merge-ready until inspectable real behavior proof is attached or explicitly overridden. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e024eacf176c. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +92, Tests +317. Total +409 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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. How this review workflow works
Review history (3 earlier review cycles)
|
Rewrite-ready proof — intentionally unmergedRewrote this PR on the current TUI architecture instead of landing the original parallel reload coordinator. Why the rewrite
The rewritten head Evidence
No protocol, subscription, config, storage, provider, or plugin SDK changes. This PR is intentionally left open and unmerged per maintainer request. |
|
This assigned pull request has been automatically marked as stale after being open for 27 days. |
Fix cross-client terminal history synchronization without letting stale snapshots erase in-flight responses. Bound orphaned stream assembly, preserve session and agent ownership, and cover real Gateway delivery, persistence races, reconnects, and stress bursts. Closes #38829. Credits prior issue investigation in #96252 and bounded-stream work in #109492. Co-authored-by: Harjoth Khara <[email protected]> Co-authored-by: Wynne668 <[email protected]>
|
Thank you for tracking down the missing live session-message handling. This is now fixed on main by #114443 (ac6009e), which folds the same Gateway event into the canonical, agent-scoped TUI history path and adds real two-client Gateway PTY coverage. Your investigation is credited in the merged PR and you are recorded as a commit co-author. Closing this PR as superseded by the landed fix. |
…114443) Fix cross-client terminal history synchronization without letting stale snapshots erase in-flight responses. Bound orphaned stream assembly, preserve session and agent ownership, and cover real Gateway delivery, persistence races, reconnects, and stress bursts. Closes openclaw#38829. Credits prior issue investigation in openclaw#96252 and bounded-stream work in openclaw#109492. Co-authored-by: Harjoth Khara <[email protected]> Co-authored-by: Wynne668 <[email protected]>
What Problem This Solves
Fixes #38829. The Gateway already broadcasts
session.messagewhen another client appends a displayable transcript entry, but the running TUI ignored that event. The selected transcript therefore stayed stale until a manual reload or session switch.Why This Change Was Made
This is a current-shape rewrite of the original contribution. The earlier version handled the event but duplicated newer run-aware reload state and did not fully protect against stale async results after selection changes.
User Impact
Messages sent from another OpenClaw surface appear in an already-running TUI without a restart. Local streaming/final output remains visible until the persisted transcript is authoritative, and switching sessions cannot be undone by a late response from the old selection.
Evidence
Exact rewritten head:
b0253c29756bc7fca22a09a7bc495ef5f03de654.cbx_3c73747f4601, runrun_c23cbeab4a86: original event-handler/session-action baseline, 124 tests passed.tbx_01kwxhf00awefzyke5p0phz686: rewritten event-handler/session-action suites, 141 tests passed.pnpm check:test-typespassed;OPENCLAW_TUI_PTY_INCLUDE_LOCAL=1 pnpm test src/tui/tui-pty-local.e2e.test.tspassed, 9/9.sessions.send, and observed the unique marker appear in the running transcript without restart, direct state mutation, or test-only event injection.Hosted exact-head CI passed in run 28846887328, and the repo-native
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 96252gate accepted this exact head. The PR is intentionally left unmerged for maintainer review.Risk / Compatibility
No config, storage, provider, protocol, or plugin SDK changes. Risk is confined to TUI transcript refresh ordering. The rewrite keeps one history-reload owner and makes the run/persistence barrier and selection identity explicit.
AI Assistance
AI-assisted rewrite and review. The maintainer inspected the full event, history-loading, run-terminal, Gateway subscription, and real PTY paths.