Repository navigation
fix(tui): keep session modes scoped on switch - #117658
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 6:10 PM ET / 22:10 UTC. ClawSweeper reviewWhat this changesThis PR clears fast, verbose, trace, and reasoning overrides when the terminal UI changes sessions, preserves sparse same-session patches, and renders trace plus launch-fixed delivery state in the footer. Merge readinessThis PR is still necessary: current Priority: P2 Review scores
Verification
How this fits togetherThe terminal UI switches an active session before loading a sparse backend snapshot. That projection drives both the visible footer and subsequent terminal commands, so retained fields can make the selected session inherit another session’s modes. flowchart LR
A[Session command or picker] --> B[Session-selection action]
B --> C[Clear prior session modes]
C --> D[Load sparse session snapshot]
D --> E[Active session projection]
E --> F[Compact TUI footer]
E --> G[Next session command]
H[Launch delivery setting] --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +44, Tests +177. Total +221 across 9 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused session-owner repair once the exact merge result has the required checks, retaining the regression pair that distinguishes a true session switch from a sparse same-session patch. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source establishes the stale sparse-merge mechanism, and the branch’s focused fake-backend PTY case exercises the real Is this the best way to solve the issue? Yes. The session-selection action owns the invalid carry-over, so clearing only selection-owned overrides there while retaining sparse same-session merge semantics is the narrowest maintainable repair. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 59f1f4f3fdd7. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for
Risk is low: no config, storage, protocol, auth, provider, or delivery-policy contract changes. Production delta is |
|
Merged via squash.
|
* fix(tui): keep session footer modes truthful * test(tui): record footer behavior evidence
Closes #117654
What Problem This Solves
Fixes an issue where switching TUI sessions could retain the previous session's fast, verbose, trace, and reasoning modes, leaving the footer and subsequent turns bound to stale session behavior.
Why This Change Was Made
The session-selection owner now clears selection-scoped mode overrides before rendering and loading the new history. Same-session patches keep their existing sparse-merge behavior. One footer formatter now renders the authoritative session modes, including trace, plus the process-fixed delivery mode; existing model, goal, and token information is preserved.
User Impact
Operators can switch sessions without inheriting another session's execution/display modes. The footer now makes effective trace and delivery behavior visible, so it accurately describes the session and launch mode used by the next turn.
Evidence
tbx_01kyzewrgye0jyjk2m6xtsethw, run https://github.com/openclaw/openclaw/actions/runs/30716208274: 146 focused unit tests and 51 PTY scenarios passed, followed by a clean changed gate.tbx_01kyzmhgc5qmxpp0p1mna36d8g, run https://github.com/openclaw/openclaw/actions/runs/30719757458: 146 focused unit tests, all 52 PTY scenarios, and the complete changed gate passed.tbx_01kyzn19k2a1hsa6mpw4mvz6mr, run https://github.com/openclaw/openclaw/actions/runs/30720064361: 146 focused unit tests, all 52 PTY scenarios, and the complete changed gate passed onfd2a561f2483deeb04a8fd33e3ca234cda6dfe70.tbx_01kyzngy6wnbs1cjvt4p0te19g, run https://github.com/openclaw/openclaw/actions/runs/30720366855: the exact footer scenario passed with all other PTY cases filtered, and the public[behavior-evidence] tui-session-footerrecord confirmed source modes visible, target modes cleared, trace transition visible, and fixed delivery propagated.deliver:onremains launch-owned, and confirms the sent turn carriesdeliver: true.@earendil-works/pi-tuiTextandvisibleWidthto verify the compact footer wraps within terminal width.origin/main: TruffleHog clean, zero findings, patch correct at 0.99 confidence (thread019fbf59-1e6a-7c03-8a7e-05a2227d4604).git diff --checkpassed. Production delta is+109/-79(net+30); tests/support are+233/-42(net+191).Release-note context: TUI session switches now clear stale per-session modes, and the footer reports trace plus fixed delivery state.
AI-assisted: yes. The session-selection owner, sparse patch semantics, footer renderer, PTY lifecycle, direct
pi-tuicontract, current-main history, and sibling same-session behavior were independently reviewed. No agent transcript is attached.