Repository navigation
feat: continue dashboard sessions from CLI URLs - #120893
Conversation
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
|
Codex review: needs maintainer review before merge. Reviewed August 9, 2026, 4:46 PM ET / 20:46 UTC. ClawSweeper reviewWhat this changesAdds dashboard URL, host/reference, and bare-reference targets to TUI, attach, and bare-root CLI flows, resolving them through the selected Gateway. Merge readinessKeep open: current main still accepts only existing TUI and attach session inputs, while this PR adds the missing dashboard-to-CLI continuation flow. The patch has no supported correctness finding, but GitHub reports a dirty merge state and this maintainer-authored, protected PR needs exact-head reconciliation before landing. Priority: P2 Review scores
Verification
How this fits togetherCLI session targets are parsed into a Gateway origin, agent, and session reference, then resolved by the Gateway before TUI or a scoped attach grant uses the resulting canonical session. The selected session and agent owner feed terminal behavior and MCP tool scope. flowchart LR
A[Dashboard URL or session reference] --> B[CLI target parser]
B --> C[Gateway connection and origin auth]
C --> D[Gateway session resolver]
D --> E[Terminal UI]
D --> F[Scoped attach grant]
F --> G[MCP tool context]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +673, Tests +1046, Docs +76, Config +1, Generated 0, Other +168. Total +1964 across 40 files. View PR surface stats
Review metrics
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: Rebase and resolve the branch against current main while retaining the canonical parser → Gateway resolver → session/agent-owner flow, then validate the resolved head. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR adds a new continuation capability rather than repairing a reported existing-behavior bug; current-main source confirms the target grammar is absent. Is this the best way to solve the issue? Yes, subject to merge reconciliation: the branch reuses the canonical session URL parser and Gateway-owned resolver rather than adding client-side session-list inference. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bff0494f33b2. LabelsLabel justifications:
EvidenceWhat 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 (7 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
894521e to
e5baff0
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
82509c0 to
b94aa91
Compare
|
Merged via squash.
|
* feat(cli): ingest session targets * refactor(ui): remove gateway scope shim * docs(cli): document session targets * fix(cli): classify session target failures * fix(cli): keep session target result private * fix(cli): simplify timeout option warning * build: declare session URL contract dependency * fix(cli): parse bare session URL options symmetrically * fix(cli): preserve command-owned URL arguments * build: keep session URL contract build-only * fix: address session URL review findings * test: preserve session key mock exports * fix: keep session URL helpers internal * fix(tui): preserve URL agent for global sessions * fix(tui): keep URL agent input internal * fix(gateway): reconcile websocket protocol owner * fix(attach): preserve global session agent ownership * fix(attach): enforce global owner at grant boundary
Implements the CLI ingestion layer of #120492.
What Problem This Solves
Operators can copy a dashboard session URL, gateway-host shorthand, or bare session ref into the CLI and continue the same Gateway-owned session without reconstructing a WebSocket URL, a full session key, or an environment-variable handoff.
Why This Change Was Made
This adds one typed CLI parser for dashboard URLs, host shorthand, and bare refs; wires positional targets into
openclaw tuiandopenclaw attach; and routes bare-rootopenclaw <url>directly through the TUI option path. It also gives the connection/resolve path actionable version-skew and origin-aware errors, removes the Control UI gateway-scope compatibility shim after migrating its remaining importer, and documents both continuation modes.The error matrix distinguishes an older Gateway's closed-object rejection, a missing session, an unreachable named origin (including a
*.ts.netTailscale hint), and a revoked device token while preserving TLS pin failures unchanged. Remote not-found guidance points to the exact Gateway Control UI becauseopenclaw sessions listcurrently has no--urloption.ClickClack session-URL deduplication and the plugin-SDK session-URL re-export were split into #120810 and are intentionally absent from this PR.
Named follow-up: insufficient stored device scope does not yet expose a typed call-layer reason. That is outside the requested error matrix and is not changed here.
User Impact
Users can now run
openclaw tui <url|host/ref|ref>,openclaw attach <url|host/ref|ref>, or the bare-rootopenclaw <url>form and reach the intended remote session with direct, origin-scoped connection options. Failures now explain the relevant recovery path instead of collapsing into a generic connection or resolution error.Evidence
+794/-157; tests+788/-1; docs+79/-3.Candidate follow-up: the Control UI still scopes short-link resolution by the decorative URL agent in
ui/src/pages/chat/route-loader-short-resolve.ts; this PR intentionally leaves that shipped #120512 behavior unchanged while the CLI moves to agent-independent resolution.Product scope
Bare-root
openclaw <url>and positional URL/ref targets onopenclaw tuiandopenclaw attachare intentional grammar, complementary continuation surfaces toopenclaw resume-style flows. Refs and URLs support cross-gateway, browser-to-terminal handoff of a session link and deliberately reuse the Control UI URL contract. This is the repository-owner-approved design in #120492.