Repository navigation
feat(cli): openclaw resume attaches the TUI to a recent session - #120664
Conversation
|
Codex review: needs changes before merge. Reviewed August 9, 2026, 3:50 AM ET / 07:50 UTC. ClawSweeper reviewWhat this changesThis PR adds Merge readinessKeep open: the latest head still lacks the previously requested Gateway-boundary regression for agent-qualified global sessions. Priority: P1 Review scores
Verification
How this fits togetherThe resume command lists recent sessions through the Gateway, chooses one by query or picker, then launches the TUI. The TUI converts a qualified session key into Gateway history and send requests for the selected agent. flowchart LR
Terminal[Interactive terminal] --> Resume[Resume command]
Resume --> List[Gateway session list]
List --> Select[Session selection]
Select --> TUI[Terminal UI]
TUI --> History[Gateway history and send]
History --> Session[Selected agent session]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +300, Tests +249, Docs +78. Total +627 across 19 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Add one focused ephemeral Gateway/protocol regression that observes Do we have a high-confidence way to reproduce the issue? Not applicable to a new feature; the missing proof is source-reproducible because the branch tests stop before the real TUI-to-Gateway request boundary. Is this the best way to solve the issue? No: the current resolver and mock tests are not the best proof for a session-ownership change; a Gateway-boundary regression is narrower and directly validates the invariant. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 499d81cdbdad. LabelsLabel justifications:
EvidenceAcceptance criteria:
What 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 (6 earlier review cycles)
|
cc4b104 to
eb342b0
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
7e13f28 to
ef1143d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
272147e to
4f9f79a
Compare
Implements docs/plan/runners.md milestone 2.
4f9f79a to
745033a
Compare
|
Merged via squash.
|
…claw#120664) * feat(cli): openclaw resume attaches the TUI to a recent session Implements docs/plan/runners.md milestone 2. * fix(cli): resume covers global sessions and preflights TTY * fix(cli): require a terminal before resume * fix(cli): adapt resume gateway disconnect state * fix(cli): preserve global resume ownership * test(cli): prove qualified global resume crosses the gateway boundary
What Problem This Solves
A session started anywhere (web Control UI, a channel, a cloud worker) has no ergonomic CLI continuation path.
openclaw tui --session <key>requires knowing the rawagent:<id>:<key>string; the TUI's Ctrl+P picker exists only after you're already attached. docs/plan/runners.md milestone 2 ("Session continuation ergonomics").Why This Change Was Made
Adds the
openclaw resume [query]verb (verbs, not a second noun command — per the plan's naming rulings):runTuipath with the resolved--sessionkey;--url/--token/--password/--tls-fingerprintpass through identically toopenclaw tui. No gateway auto-start; unreachable gateway fails with the same guidance the TUI gives.Refactor included: the Ctrl+P picker's session-listing + label/preview building was extracted into a shared
src/tui/tui-session-picker.tsowner consumed by both the TUI selector and the new command (−45 LOC in tui-command-handlers.ts), so the two pickers cannot drift.No protocol changes;
sessions.listis used as-is.Release-note context: CLI session resume —
openclaw resume [query]finds a recent Gateway session by key or name and attaches the TUI.User Impact
openclaw resume/openclaw resume big-refactorcontinues any recent session from the terminal, including sessions running on cloud workers — clients attach to sessions, placement is irrelevant. New docs page: /cli/resume.Evidence
node scripts/run-vitest.mjs src/cli/resume-cli.test.ts src/cli/program/register.subclis.test.ts: 2 files, 151 tests passed.ClawSweeper moves
P3 plan status: applied (rows 0/1a/1b/2 updated). P1 boundary test: skipped in this PR — needs a new lightweight gateway test harness (existing helper ~370s under CLI vitest config); recorded as a named follow-up in docs/plan/runners.md milestone 2.
Round-4 P1 (exercise qualified global resume through a Gateway operation): skipped — requires the lightweight CLI-side gateway harness recorded as a named follow-up in docs/plan/runners.md milestone 2 (existing helper ~370s under the CLI vitest config). Code behavior verified: bare-global rows are excluded from resume listing; explicit agent-qualified keys pass to the TUI unchanged.