Skip to content

fix(gateway): let wizard clients control daemon installation - #109412

Closed
TheAngryPit wants to merge 1 commit into
openclaw:mainfrom
TheAngryPit:codex/wizard-start-install-daemon-v2
Closed

TheAngryPit wants to merge 1 commit into
openclaw:mainfrom
TheAngryPit:codex/wizard-start-install-daemon-v2

Conversation

@TheAngryPit

Copy link
Copy Markdown
Contributor

What Problem This Solves

Remote wizard clients can already express whether onboarding should install a daemon through OnboardOptions.installDaemon, but the Gateway RPC contract rejected that field and wizard.start did not forward it.

This blocks clients that own the service lifecycle themselves, including the Windows Companion setup flow. Passing installDaemon=false must prevent the Gateway-hosted wizard from installing a competing daemon inside the managed environment.

Related Windows Companion work:

Why This Change Was Made

This keeps ownership at the existing native boundary:

  • add the optional boolean to the closed WizardStartParamsSchema;
  • forward the exact value, preserving explicit false, true, and omission;
  • keep Gateway-hosted wizard runs headless with skipUi=true;
  • suppress token-bearing terminal output with suppressGatewayTokenOutput=true.

No new lifecycle mechanism or client-specific branch is introduced.

User Impact

Wizard RPC clients can now explicitly opt out of daemon installation while retaining the existing default when the field is omitted.

This lets a Companion-managed installation own service creation without changing CLI onboarding behavior.

Evidence

  • Focused wizard.start regression: 6/6 executions passed across the configured Vitest projects.
  • Cases cover installDaemon=false, true, and omitted.
  • The same test verifies skipUi=true and suppressGatewayTokenOutput=true.
  • Focused tsgo, oxfmt --check, and oxlint passed.
  • git diff --check passed.
  • Scoped Codex Auto-review on current head returned zero findings: patch is correct, confidence 0.96.

Failed-first evidence was retained during development: a broad Gateway WebSocket test exceeded its inherited 90-second limit, so the PR uses a dedicated handler-level regression rather than claiming that timeout as proof. The first focused typecheck also caught a potentially absent indexed handler; the test now asserts registration before invocation.

Scope

This PR changes only the Gateway wizard protocol projection and its focused regression test. It does not modify Windows Companion code, service defaults, packaging, migrations, or unrelated beta fixes.

The PR remains draft until the paired Windows Companion flow is validated against an official OpenClaw artifact containing this change.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime size: S labels Jul 16, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 16, 2026, 7:56 PM ET / 23:56 UTC.

Summary
The PR adds an optional installDaemon parameter to wizard.start, forwards it into onboarding with headless and token-output suppression flags, and adds a focused handler regression test.

PR surface: Source +4, Tests +61. Total +65 across 3 files.

Reproducibility: yes. from source: the closed wizard.start schema and handler omit an existing OnboardOptions.installDaemon value, so a client-supplied field is rejected or lost before finalization. A live current-main setup run was not performed.

Review metrics: 1 noteworthy metric.

  • Gateway RPC surface: 1 optional parameter added. The new boolean extends a public control-plane contract, so omission and explicit-value behavior should be verified before merge.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix proof from the paired Windows Companion setup showing that no competing daemon is installed.
  • Rebase onto current main and refresh the focused gateway protocol and handler validation.

Proof guidance:

  • [P1] Needs real behavior proof before merge: Focused mocked handler tests and static checks are present, but the PR itself says paired Windows Companion validation is pending; add a redacted live setup transcript, terminal output, logs, or recording, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The handler-level test does not prove that a real Companion-managed installation sends installDaemon=false, completes onboarding, and leaves service creation exclusively with the Companion.
  • [P1] The branch is behind current main, so the focused review and validation should be refreshed after rebasing before merge.

Maintainer options:

  1. Decide the mitigation before merge
    Land the additive RPC projection after a redacted paired Windows Companion run proves that explicit false avoids daemon installation, omission preserves existing behavior, and the gateway-hosted wizard neither launches local UI nor exposes token-bearing output.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] The code change has no identified mechanical defect for ClawSweeper to repair; the remaining merge gate is contributor-supplied real setup proof and normal draft refresh.

Security
Cleared: The additive admin-scoped RPC field introduces no concrete security or supply-chain regression, and suppressing token-bearing wizard output improves the gateway-hosted boundary.

Review details

Best possible solution:

Land the additive RPC projection after a redacted paired Windows Companion run proves that explicit false avoids daemon installation, omission preserves existing behavior, and the gateway-hosted wizard neither launches local UI nor exposes token-bearing output.

Do we have a high-confidence way to reproduce the issue?

Yes from source: the closed wizard.start schema and handler omit an existing OnboardOptions.installDaemon value, so a client-supplied field is rejected or lost before finalization. A live current-main setup run was not performed.

Is this the best way to solve the issue?

Yes. Extending the existing RPC schema and forwarding the value into the established onboarding option is narrower and more maintainable than adding client-specific lifecycle logic.

AGENTS.md: unclear because the file could not be read completely.

Codex review notes: model internal, reasoning high; reviewed against 4a7abe1556e3.

Label changes

Label changes:

  • add P2: This is a bounded gateway onboarding fix for a managed-client workflow, with limited blast radius and no evidence of a shipped emergency regression.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Focused mocked handler tests and static checks are present, but the PR itself says paired Windows Companion validation is pending; add a redacted live setup transcript, terminal output, logs, or recording, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded gateway onboarding fix for a managed-client workflow, with limited blast radius and no evidence of a shipped emergency regression.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: Focused mocked handler tests and static checks are present, but the PR itself says paired Windows Companion validation is pending; add a redacted live setup transcript, terminal output, logs, or recording, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Source +4, Tests +61. Total +65 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 2 4 0 +4
Tests 1 61 0 +61
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 65 0 +65

What I checked:

  • Current-main gap: The current wizard.start setup path forwards only mode and workspace, so the onboarding service-install preference cannot reach the existing wizard implementation. (src/gateway/server-methods/wizard.ts:98, 4a7abe1556e3)
  • Existing onboarding contract: OnboardOptions already defines installDaemon?: boolean; this PR exposes that existing option rather than creating a second lifecycle mechanism. (src/commands/onboard-types.ts:67, 4a7abe1556e3)
  • Callee semantics: The onboarding finalizer preserves explicit true and false, while omission retains the established platform, quickstart, or prompt-based decision path. (src/wizard/setup.finalize.ts:2534, 4a7abe1556e3)
  • Headless and secret-safe projection: The finalizer uses skipUi to avoid local UI/TUI launch behavior and suppressGatewayTokenOutput to omit token-bearing URLs and token guidance, supporting the PR's gateway-hosted boundary. (src/wizard/setup.finalize.ts:2837, 4a7abe1556e3)
  • Focused regression coverage: The added test covers explicit false, explicit true, and omission while asserting the two gateway-hosted safety flags. (src/gateway/server-methods/wizard.test.ts:11, 90dc7533822f)
  • Real behavior proof gap: The PR body reports mocked handler tests and static checks, and explicitly says paired Windows Companion validation against an official artifact is still pending. (90dc7533822f)

Likely related people:

  • steipete: Broad recent repository ownership around gateway, onboarding, and release behavior makes this the best available routing candidate, but direct file-history confirmation was blocked by the read-only shell failure. (role: adjacent gateway and onboarding owner; confidence: low; files: src/gateway/server-methods/wizard.ts, src/wizard/setup.finalize.ts, packages/gateway-protocol/src/schema/wizard.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@TheAngryPit

Copy link
Copy Markdown
Contributor Author

Superseded by #110382. The consolidated PR now includes the non-exiting RPC wizard runtime, the optional installDaemon protocol field and forwarding contract, explicit RPC safety flags, and the combined test matrix. It is linked to canonical issue #110545 and has passed focused current-main Crabbox proof plus scoped Auto-review. Closing this overlapping PR keeps one issue and one implementation lane for the Gateway owner boundary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants