@@ -15,6 +15,7 @@ the Gateway; `resume` selects it and opens the existing [TUI](/cli/tui).
1515``` bash
1616openclaw resume
1717openclaw resume < query>
18+ openclaw resume --handoff < payload>
1819```
1920
2021With no query, OpenClaw displays up to 50 sessions active in the last seven
@@ -33,23 +34,80 @@ status 1. If no recent session matches, it suggests the picker and
3334
3435| Flag | Default | Description |
3536| ---------------------------- | -------------------------------- | ------------------------------------------------------------------- |
37+ | ` --handoff <payload> ` | (none) | Opaque session key and Gateway URL copied from the Control UI. |
3638| ` --url <url> ` | ` gateway.remote.url ` from config | Gateway WebSocket URL. |
3739| ` --token <token> ` | (none) | Gateway token if required. |
3840| ` --password <pass> ` | (none) | Gateway password if required. |
3941| ` --tls-fingerprint <sha256> ` | ` gateway.remote.tlsFingerprint ` | Expected TLS certificate fingerprint for a pinned ` wss:// ` Gateway. |
4042
41- ` resume ` uses the same Gateway URL, authentication, and TLS resolution as
42- [ ` openclaw tui ` ] ( /cli/tui ) . It never starts a Gateway automatically. If the
43- configured Gateway is unavailable, start or repair it and rerun the command.
43+ ` --handoff ` cannot be combined with a positional query or ` --url ` because it
44+ authoritatively supplies both. You can combine it with ` --token ` , ` --password ` ,
45+ and ` --tls-fingerprint ` ; those explicit authentication values keep their normal
46+ highest priority.
47+
48+ ` resume ` never starts a Gateway automatically. If the configured Gateway is
49+ unavailable, start or repair it and rerun the command.
4450
4551` resume ` resolves configured Gateway auth SecretRefs for token/password auth
4652when possible (` env ` /` file ` /` exec ` /` store ` providers).
4753
48- Gateway target precedence is explicit ` --url ` , then ` OPENCLAW_GATEWAY_URL ` ,
49- then ` gateway.remote.url ` when ` gateway.mode ` is ` remote ` , then the local
50- loopback Gateway. For that local Gateway, ` OPENCLAW_GATEWAY_PORT ` takes
51- precedence over the active port recorded by a running Gateway, which takes
52- precedence over the configured or default ` gateway.port ` .
54+ When present, ` --handoff ` supplies the target Gateway URL. Otherwise, Gateway
55+ target precedence is explicit ` --url ` , then ` OPENCLAW_GATEWAY_URL ` , then
56+ ` gateway.remote.url ` when ` gateway.mode ` is ` remote ` , then the local loopback
57+ Gateway. For that local Gateway, ` OPENCLAW_GATEWAY_PORT ` takes precedence over
58+ the active port recorded by a running Gateway, which takes precedence over the
59+ configured or default ` gateway.port ` .
60+
61+ An explicit target normally requires an explicit ` --token ` or ` --password ` ;
62+ OpenClaw does not borrow credentials or a TLS pin from a different configured
63+ target. ` resume ` has one narrow exception for a handoff copied from the Control
64+ UI: when its Gateway URL byte-for-byte matches a canonical target of the current
65+ profile, it may reuse that profile's configured interactive auth, SecretRef,
66+ and stored exact-origin device auth. In local mode, the eligible targets are the
67+ current local target with ` gateway.controlUi.basePath ` and ` gateway.publicOrigin `
68+ converted to WebSocket form with that base path. In remote mode, only the exact
69+ ` gateway.remote.url ` is eligible. TLS pin ownership is narrower: an exact
70+ direct-local target may reuse the
71+ local Gateway certificate fingerprint, and an exact configured remote target
72+ may reuse ` gateway.remote.tlsFingerprint ` ; a public-origin target never inherits
73+ the local listener's pin. Pass ` --tls-fingerprint ` explicitly when that public
74+ origin needs a pin. A host, port, path, profile, query, or fragment mismatch
75+ fails closed under the normal explicit-target policy. OpenClaw never scans
76+ other profiles for a match. Handoff connections also ignore ambient
77+ ` OPENCLAW_GATEWAY_TOKEN ` and ` OPENCLAW_GATEWAY_PASSWORD ` fallback, so shell
78+ credentials for another Gateway cannot cross into the selected target. Explicit
79+ flags and credentials owned by an exact configured target remain eligible.
80+
81+ ## Continue from the Control UI
82+
83+ Open the selected session's header menu and choose ** Continue in terminal…** .
84+ The dialog shows one copyable ` openclaw resume --handoff <payload> ` command.
85+ The opaque payload is versioned, bounded, and encoded with an unpadded URL-safe
86+ base64 alphabet, so the command needs no quoting and is safe to paste in common
87+ POSIX shells, PowerShell, and ` cmd.exe ` . The encoded argument is limited to 4096
88+ characters; inside it, the agent-qualified session key is limited to 512
89+ user-perceived characters and the Gateway URL to 2048 characters. It contains
90+ only the exact qualified session key and selected Gateway WebSocket URL,
91+ including any Control UI base path. It contains no token, password, device
92+ credential, or bootstrap credential, and the browser does not execute it.
93+
94+ The Control UI does not offer this command when the selected Gateway URL uses a
95+ query string. Gateway authentication and stored device scope are origin-based,
96+ not query-aware, so OpenClaw never strips or copies that query into a
97+ credential-free handoff. Use a manually authenticated CLI target with explicit
98+ ` --token ` or ` --password ` , or configure a queryless Gateway URL.
99+
100+ Run the command in an already configured OpenClaw terminal. The terminal
101+ authenticates independently. Before opening the TUI, ` resume ` asks that Gateway
102+ to resolve the qualified key and uses the returned canonical key. A deleted or
103+ stale session stops with guidance to copy a fresh command; it never starts a new
104+ session. The Gateway's session access controls remain authoritative. This flow
105+ continues an existing session; it does not delegate first-use authentication
106+ from the browser.
107+
108+ If OpenClaw reports an invalid ` --handoff ` payload, return to the session's
109+ Control UI menu and copy a fresh command. Do not edit or reuse a truncated
110+ payload.
53111
54112## Examples
55113
@@ -65,6 +123,9 @@ openclaw resume bugfix
65123
66124# Remote Gateway override
67125openclaw resume bugfix --url wss://gateway.example.com --token < token>
126+
127+ # Opaque command copied from the Control UI
128+ openclaw resume --handoff < payload>
68129```
69130
70131## Related
0 commit comments