Repository navigation
fix(tui): keep session refreshes on the selected agent - #158240
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 2:18 PM ET / 18:18 UTC. ClawSweeper reviewWhat this changesThe branch makes TUI description refreshes and remembered-session restoration retain the selected agent when another agent has the same session name, with focused tests and a documentation update. Merge readiness✅ Ready for maintainer review Current main still permits a session-key suffix collision during TUI refresh. This focused PR addresses a distinct remaining defect; the related umbrella branches are unmerged and do not replace it. Priority: P1 Review scores
Verification
How this fits togetherThe terminal UI selects an agent and conversation, then asks a Gateway or local backend for session details. Returned details and remembered selections affect the header, footer, and conversation shown to the user. flowchart LR
A[Selected agent and session] --> B[Description request]
B --> C[Gateway or local backend]
C --> D{Same agent and conversation?}
A --> E[Remembered session lookup]
E --> D
D -->|Yes| F[Update TUI selection and details]
D -->|No| G[Keep current selection]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2, Tests +48, Docs 0. Total +46 across 8 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep description refresh and remembered restoration bound to the selected agent and conversation while preserving bare-key aliases and opaque provider identities. Do we have a high-confidence way to reproduce the issue? Yes. The inspected before capture shows Work history with Main metadata in the real TUI loop using a synthetic backend, and current main retains the matching code; I did not execute that loop during this read-only review. Is this the best way to solve the issue? Yes. The patch uses existing session ownership checks at the TUI boundary and preserves alias behavior without changing persistence or the wire protocol. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cac0c021273a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash auto-merge.
|
Backport #157564: 4bfac2b Backport #157881: 0b234fc Backport #158240: df5e316 Preserve native Ollama free-form schema parameters, project Twitch Disabled to explicit deny-all, and retain TUI session ownership across delayed state. No new policy, dependencies or version changes. Co-authored-by: Hmache Abdellah <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
Preserve qualified owners during request-key comparison and reuse existing TUI owner checks for returned descriptions and remembered sessions. Keep bare aliases and opaque provider identities unchanged. Refs openclaw#150153 Refs openclaw#152895
Refs #150153. Continues the bounded TUI selection work preserved in #152895; neither umbrella is closed by this PR.
What Problem This Solves
Fixes the TUI switching its session details or remembered selection to another agent when the returned conversation has the same session-key suffix.
User Impact
The selected agent, header, footer, and remembered conversation stay consistent. Existing bare-key aliases and case-sensitive provider identities remain supported; no configuration or data migration is required.
Why This Change Was Made
The request-key comparison discarded both qualified owners, while description and restore callers trusted the matching suffix. The repair retains qualified ownership and reuses the existing owner checks for returned descriptions and remembered rows. The subscription/ACK protocol and persistence owners are unchanged.
Evidence
runTui()loop reproduced the mismatch with a synthetic backend: Work history stayed visible while the old description refresh adopted Main. Identical inputs after the repair retained Work. Both native runs joined and their owned terminals were closed. This proves the TUI boundary, not live Gateway transport or provider behavior.2aee10b0879d. After capture: this PR's production files, individually hash-bound to the inspected image. Both complete images contain only synthetic content and were delivered inline in the originating chat.The initial six-file run took 55.72 seconds, including 24.15 seconds of maintained worker compilation. Reported case-execution spans were 158 ms for session-key tests, 610 ms for remembered-session tests, and 534 ms for session actions. After extracting the description cases, their six cases totaled 28 ms and the remaining session-action cases totaled 520 ms. These are summed test-reporter spans, not isolated end-to-end benchmarks.
This is one internal selection correction. Broader logical identity, exact-main/Home, wire compatibility, and the original asynchronous database work remain tracked in #150153.
Visual proof
The same synthetic Work conversation and command are shown before and after.