-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Wizard RPC parity for non-terminal clients (progress, QR/media, auth-challenge capability) #94661
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Description
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.ClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Priority
None yet
Summary
The interactive setup wizard runs locally (terminal
clackprompter) and over an RPC protocol so non-terminal clients (the Windows companion app, remote nodes) can drive onboarding (wizard.start/wizard.next/wizard.cancel/wizard.statusinsrc/gateway/server-methods/wizard.ts). The RPCWizardSessionPrompter(src/wizard/session.ts) mapsnote/select/text/confirm/multiselectinto protocol steps — but several onboarding affordances are still delivered through channels the RPC client never sees, so a companion-driven onboarding can stall or dead-end.#94300 fixed one instance of this (OAuth authorization URLs were only written to gateway stdout; now they ride in-band in the wizard prompt via a
presentsAuthChallengeprompter capability). This issue tracks the rest of the parity gap so non-terminal clients can complete onboarding end to end.Gaps
1. Progress is dropped over RPC
WizardSessionPrompter.progress()returns a no-opupdate/stop(src/wizard/session.ts). Everyspin.update(...)during installs, plugin/channel downloads, device-code/OAuth waits, and gateway health probes is silently discarded for RPC clients, so the companion looks frozen during the slowest parts of onboarding.Root cause: the wizard RPC is pull-based request/response —
wizard.nextreturns exactly one step and blocks until the runner produces it. Progress updates fire while the runner is mid-operation, when there is no pending step to return.Proposed direction: let
progress()enqueue a non-blockingprogressstep (theWizardStepschema already has aprogresstype) thatwizard.nextreturns withdone:false; the client re-pollswizard.nextwithout an answer to continue. Requires movingWizardSessionfrom a single pending step to a small step queue, and a documented "progress steps are non-interactive; re-poll without answering" client contract.2. Connection / device-pairing QR is not available to non-terminal clients
Correction (validated against code): there are two distinct QR surfaces; only one is a gap.
Channel-login QR (WhatsApp etc.) — already solved over RPC.
web.login.start/web.login.wait(src/gateway/server-methods/web.ts) delegate to the channel plugin'sloginWithQrStart/loginWithQrWaitand already returnqrDataUrl(with refresh viacurrentQrDataUrl). A companion can drive channel linking today; no new RPC needed. Theruntime.logQR inextensions/whatsapp/src/login.tsis just the terminal fallback for the CLI path.Connection / device-pairing QR — the real gap. The OpenClaw mobile app (and Windows companion) scans a QR to connect to the gateway. The gateway already accepts such clients (the native QR/setup-code mobile bootstrap seam in
src/gateway/server/ws-connection/message-handler.ts; approval RPCsnode.pair.*/device.pair.*). But the produce/display side — the setup-code + QR the device scans — is CLI-only:openclaw qr(src/cli/qr-cli.ts) builds it viaresolvePairingSetupFromConfig+encodePairingSetupCode(src/pairing/setup-code.ts) and renders ASCII to stdout. There is no gateway RPC that returns{ setupCode, qrDataUrl, gatewayUrl, auth }so a companion / GUI / Control UI can display the connect-QR.Proposed direction: add a gateway RPC (e.g.
pairing.setupCode, scopeoperator.pairing) that reusesresolvePairingSetupFromConfig+encodePairingSetupCode+renderQrPngDataUrl(src/media/qr-image.ts) to return the setup code and QR data URL. The companion renders the QR; the existing mobile-bootstrap consume seam handles the scan-to-connect.3.
presentsAuthChallengeis an ad-hoc capability#94300 introduced
prompter.presentsAuthChallengeto gate in-band OAuth URLs. Promote it to a documented prompter capability so providers/channels have a stable seam, and sweep the remaining user-actionableruntime.logemissions in onboarding for in-band delivery (e.g. the shared local OAuth path insrc/plugins/provider-oauth-flow.ts).4. Guardrail
Add a seam test asserting that auth/channel onboarding steps never leave a required user action only in
runtime.logorprogress()— required artifacts (auth URL, QR, code) must appear in a protocol-visible step. Prevents new providers/channels from regressing the class.Proposed PR breakdown
progressstep type already exists.)pairing.setupCode) returning{ setupCode, qrDataUrl, gatewayUrl, auth }, reusing existing pairing/QR helpers; companion render follows inopenclaw-windows-node/ iOS.presentsAuthChallenge+ leak sweep + guardrail (gaps 3, 4).Related landed/open work: #94300 (OAuth authorization URL carried in the wizard text prompt) and #94664 (progress). Both were validated to need no rework for this design — OAuth is an in-wizard interactive step (URL belongs in the prompt message), and channel/connection QR are separate companion-driven RPCs, so there is no single field that unifies them.
Each core PR ships the protocol capability and core tests; client rendering (Windows companion, iOS) lands separately.
Why an issue first
These touch the gateway wizard protocol (
packages/gateway-protocolschema +src/wizard/session.tssemantics) and a new pairing RPC, which are additive but client-visible, and the companion work spansopenclaw-windows-node/ iOS. Filing here so maintainers can confirm the shape (progress-step semantics; thepairing.setupCodeconnection-QR RPC) before the PRs land.Related: #94300 (OAuth authorization URL in wizard prompts).
AI-assisted: Yes.