fix(ui): preserve local session continuity#75948
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. The target flow is reproducible by loading Next step before merge Security Review detailsBest possible solution: Use this PR as the narrow canonical fix for local Control UI/TUI session continuity, keep #63229 separate, and land after exact-SHA CI and maintainer approval finish. Do we have a high-confidence way to reproduce the issue? Yes. The target flow is reproducible by loading Is this the best way to solve the issue? Yes. The updated approach is the narrow maintainable path: make What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1ecb2fc2c72a. |
2db4f12 to
335b98e
Compare
|
CI note after the latest force-push: the branch-local and Testbox changed gate are green, but the exact-SHA GitHub CI run is currently red on two files outside this PR diff: |
335b98e to
afff9ad
Compare
|
ClawSweeper P1 addressed in afff9adac2. The chat.send schema now accepts the history-backed sessionId, and the gateway carries that id as the backing fallback for abort/transcript bookkeeping while keeping stored session entries authoritative. Added server coverage for chat.history returning a session id and chat.send accepting it. Validation: targeted gateway/TUI tests, unit UI chat controller test, targeted oxfmt check, and Testbox OPENCLAW_TESTBOX=1 pnpm check:changed passed on tbx_01kqkg2fcmpmt1nvk6vq20qe60. |
afff9ad to
2307902
Compare
|
Final branch refresh: rebased onto current main and resolved the changelog-only conflict. Final head is 2307902. Post-rebase validation: targeted gateway/TUI tests passed, unit UI chat controller test passed, targeted oxfmt check passed, check:changelog-attributions passed, and git diff --check passed. The earlier explicit Testbox OPENCLAW_TESTBOX=1 pnpm check:changed gate passed before this changelog-only rebase. |
|
Final CI update for c2818b6: protocol artifacts are regenerated, checks-fast-protocol is green, and the full exact-SHA CI/check set is now green. PR merge state is CLEAN. |
Fixes openclaw#63195. Closes openclaw#68162. Closes openclaw#73546. - Keep Control UI chat sends bound to the history-backed session id across reconnects. - Accept chat.send sessionId at the gateway/protocol boundary and update generated Swift models. - Resume the last selected TUI session for the same gateway/agent/scope when still present. Validated by exact-SHA CI on PR openclaw#75948.
Fixes openclaw#63195. Closes openclaw#68162. Closes openclaw#73546. - Keep Control UI chat sends bound to the history-backed session id across reconnects. - Accept chat.send sessionId at the gateway/protocol boundary and update generated Swift models. - Resume the last selected TUI session for the same gateway/agent/scope when still present. Validated by exact-SHA CI on PR openclaw#75948.
Summary
sessionIdreturned bychat.historyin Control UI and include it on follow-upchat.sendcalls after refresh/reconnect.--sessionis provided./session,/new,/reset, and explicit--sessionstill choose the active session and update the remembered TUI target only after history loads.Issue coverage
Fixes #63195.
Fixes #68162.
Fixes #73546.
Supersedes #48589 with a narrower current-main implementation that avoids the stale orphan-reattach/client-id review blockers from that PR. #63229 remains separate because its current evidence is provider/gateway timeout classification, not local client session continuity.
Validation
node scripts/run-vitest.mjs run --config test/vitest/vitest.unit-ui.config.ts ui/src/ui/controllers/chat.test.tspnpm test src/tui/tui-last-session.test.ts src/tui/tui-session-actions.test.ts src/tui/tui-command-handlers.test.ts src/tui/gateway-chat.test.tspnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/web/tui.md docs/web/webchat.md src/tui/gateway-chat.ts src/tui/tui-backend.ts src/tui/tui-command-handlers.test.ts src/tui/tui-command-handlers.ts src/tui/tui-session-actions.test.ts src/tui/tui-session-actions.ts src/tui/tui.ts src/tui/tui-last-session.test.ts src/tui/tui-last-session.ts ui/src/ui/app-render.helpers.ts ui/src/ui/app.ts ui/src/ui/controllers/chat.test.ts ui/src/ui/controllers/chat.tsgit diff --check origin/main...HEADpnpm testbox:sanity(tbx_01kqkf1ryenh4y0htv4dkwqsxv): 16 changed entries, 0 tracked deletionsOPENCLAW_TESTBOX=1 pnpm check:changed(tbx_01kqkf1ryenh4y0htv4dkwqsxv)