Skip to content

feat(onboard): guided CLI onboarding with live AI verification and classic fallback#101880

Merged
steipete merged 13 commits into
mainfrom
claude/fervent-lehmann-5e5bce
Jul 9, 2026
Merged

feat(onboard): guided CLI onboarding with live AI verification and classic fallback#101880
steipete merged 13 commits into
mainfrom
claude/fervent-lehmann-5e5bce

Conversation

@steipete

@steipete steipete commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Closes #101851

What Problem This Solves

The macOS app's first-run "Connect your AI" step live-tests every AI backend with a real completion before saving anything, falls through automatically when a candidate fails, and verifies manually entered keys before storing them. The CLI had none of that: interactive onboarding (Crestodian chat since #99935) persisted the first detected credential without any live test — a stale OPENAI_API_KEY, an expired CLI login, or a billing-dead account became the configured default model, and the failure only surfaced on the first real agent turn. A fresh machine with no CLI logins dead-ended entirely: the chat TUI takes no masked input, so there was no way to enter and verify an API key during CLI onboarding. Docs still described pre-#99935 routing (classic as the fresh-install default).

Why This Change Was Made

Interactive openclaw onboard (and bare openclaw on a fresh install) now runs a guided flow driving the same engine the macOS app uses (detectSetupInference/activateSetupInference, surface: "cli"): risk acknowledgement → workspace → detect existing AI access → live-test the recommended candidate with a real "reply OK" completion → on failure show the mapped reason (auth/rate limit/billing/timeout) and automatically try the next usable candidate → when detection is exhausted, offer every remaining/failed candidate for retry, a masked and live-verified manual API-key step built from installed provider manifests, Crestodian chat, the classic step-by-step wizard, or skip-AI. Model + workspace + quickstart gateway are persisted only after a passing test; a failing candidate never touches config. The classic wizard keeps its full surface and gains an optional post-auth live verification (never blocks completion). Candidate live-tests are classified as probes so expected failures stay out of the wizard TTY (file diagnostics unchanged), and the classic escape carries the already-collected risk acknowledgement instead of re-prompting. No new flags, config keys, or protocol changes; --classic, --modern, --non-interactive, and all scripted flags behave exactly as before.

User Impact

Fresh installs get a first chat that actually works: onboarding proves inference before claiming success, explains provider failures in plain language as it walks the ladder, and accepts a manually pasted key with masked input and the same verification — on every platform, not just macOS. Re-running openclaw onboard on a configured install now doubles as a verify/repair pass for the current model. Classic-wizard users can confirm their model answers before finishing setup.

Evidence

Live E2E on a clean Linux box (AWS Crabbox cbx_114157c63e3d, packaged tarball via scripts/package-openclaw-for-docker.mjs + npm i -g, real API keys, driven over tmux):

  • Guided happy path (live OpenAI key): detect → live test ("replied in 2.9s") → persisted openai/gpt-5.5, workspace, quickstart gateway (token auth), bootstrap files seeded, clean exit 0.
  • Ladder walk-down (invalid OpenAI + live Anthropic): OpenAI candidate fails with HTTP 401 → "✗ OpenAI API key: Authentication failed. Sign in again or check the key." → automatic fall-through → Anthropic passes ("replied in 1.8s") → anthropic/claude-opus-4-8 persisted; the failing candidate never reached config; no diagnostics leak into the TTY (re-verified after the probe-lane fix: leak count 0).
  • Manual masked key (no env creds): "No existing AI access" → provider picker from installed manifests → masked key entry → live verify passed → credential persisted to the per-agent SQLite store; key value confirmed absent from every terminal capture.
  • Classic wizard + new verify step (--classic --flow quickstart): env-key detection, Codex runtime plugin auto-install from the packaged tarball, model configured, then "Test AI access now with a live completion?" → "AI access works. Replied in 3.0s."
  • Classic escape from guided: lands in the classic flow selection without re-asking the risk acknowledgement.

Screenshots (full set + manifest):

Walk-down: OpenAI fails with mapped reason, Anthropic test starts walkdown failure
Walk-down: Anthropic verified, setup applied, honest gateway state walkdown success
Manual path: full flow with masked key entry masked key
Classic wizard: new live verification step passes classic verify
Classic escape from guided (no risk re-prompt) classic escape
Guided security notice security
Classic auth groups auth groups

Gates: pnpm check:changed exit 0 on the final head (lease tbx_01kwz4d92mmtswkykjbg7wm2pe, Testbox-through-Crabbox). pnpm test:changed on the same lease: 3 failures, all pre-existing on main and unrelated — the affected src/plugins/** files are byte-identical to origin/main; they encode the host's /tmp/openclaw state in os.tmpdir() assertions and fail on any machine where /tmp/openclaw is ownable (two-way proof + mechanism in #101876, follow-up filed). Everything else passed (e.g. gateway+agents projects: 270 files / 3296 tests green; an intermittent vitest "Worker exited unexpectedly" crash-at-shutdown on the Testbox can poison exit codes while all tests pass — observed at varying positions across runs, also unrelated to this diff). Autoreview (branch mode vs origin/main) ran to completion; its one finding (existing-model verification runs outside the configured workspace and could let the ladder silently replace a workspace-backed model) was addressed in f0342c4 by failing safe: a failed current-model check stops the auto-ladder and asks, never auto-replacing the configured default.

Focused suites locally green throughout (node scripts/run-vitest.mjs on onboard-guided, onboard, onboard-interactive, setup-inference, wizard setup, register.onboard, i18n, command-queue, logging subsystem). Known proof gap: gateway service install on the E2E box fails (systemctl --user unavailable on the headless host) — the flow reports it honestly and continues; daemon install itself is untouched by this PR.


Update: two-way switching + channel-setup guidance

The chat and the menu wizards are now fully interchangeable, and the assistant can guide channel setup with real metadata instead of guesses:

  • Chat → menus: open setup wizard (guided), open classic wizard, and open channel wizard for <channel> are new typed operations plus a ring-zero open_setup action; the chat TUI tears down first and the wizard launches in its place (mirrors the existing talk to agent handoff; the gateway/macOS chat surface returns a text pointer instead). Workspace and the already-collected risk acknowledgement carry across the switch.
  • Sensitive-step switch instead of dead end: the hosted channel wizard used to cancel at the first secret and tell you to run a command yourself; now it offers open channel wizard, remembers the channel, and hands off into the masked channels add wizard (which now preselects that channel).
  • Channel competence: new read-only channel info <channel> operation and channel_info ring-zero action surface the channel's label, blurb, configured/installed state, and its real docs.openclaw.ai/channels/... URL from channel-setup discovery. Both prompts instruct the assistant: asking about a channel → channel info + docs link; asking to connect → start the wizard directly (the distinction came from a live-test failure where the agent detoured a connect request through info).
  • Security fix found by the live test: the shared channel-token prompt lacked sensitive: true, so terminal wizards echoed pasted tokens and the chat bridge hosted a Telegram token step in visible plain text. Fixed with a regression test asserting every token prompt is sensitive; pre-existing on main but load-bearing for the masked-wizard contract this PR documents.
  • Docs updated across cli/crestodian, cli/onboard, start/wizard, and start/onboarding-overview to describe the interchangeable flows and new commands.

Live proof (fresh Linux box, packaged tarball, real OpenAI key, tmux-driven):

Natural "how do I set up slack?" → agent runs channel info slack, cites real docs URL slack question
connect telegram reaches the token step → guard fires with the switch offer sensitive offer
open channel wizard → chat exits, masked channel wizard opens masked wizard
open setup wizard → chat hands off to guided onboarding chat to guided

Gates: check:changed green on the update head (Testbox-through-Crabbox); test:changed green except five failures pre-existing on main with unchanged files, all filed: #101876 (plugins /tmp/openclaw env-coupled assertions), #101965 (browser navigation-guard vs SSRF tightening from #100835), #101966 (Slack thread-session-key ACP routing). Focused suites for every touched surface pass locally. Branch autoreview surfaced one finding (the guided flow could launch the chat TUI while the wizard prompter still owned the terminal) — fixed in 422e1b4 by mirroring the classic finalize pre/post terminal restore.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes commands Command implementations size: XL maintainer Maintainer-authored PR labels Jul 7, 2026
@clawsweeper

clawsweeper Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Codex review: found issues before merge. Reviewed July 9, 2026, 5:03 AM ET / 09:03 UTC.

Summary
The PR changes default interactive CLI onboarding to a guided live-verification flow, adds classic verification and Crestodian/channel setup handoffs, marks channel token prompts sensitive, and updates onboarding docs/tests.

PR surface: Source +1046, Tests +933, Docs +117. Total +2096 across 39 files.

Reproducibility: yes. source-reproducible: PR-head code shows the detected-env credential durability gap, selected-workspace verifier gap, and Codex install metadata loss. I did not run mutating onboarding tests in this read-only review.

Review metrics: 3 noteworthy metrics.

  • Public setup default: 1 default changed, 0 flags added, 0 config keys added. Flagless interactive CLI onboarding is a public first-run contract, so the default-flow change matters even without new configuration surface.
  • Credential durability gaps: 2 detected env-key candidate families affected. OpenAI and Anthropic shell-env candidates can be verified in-process without producing durable Gateway credentials.
  • Crestodian action surface: 2 actions added, 1 setup-target enum added. New channel_info and open_setup actions change chat/tool handoff behavior across local TUI, gateway, and setup surfaces.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/crestodian/operations.ts, migration/backfill/repair: src/wizard/i18n/locales/en.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #101851
Summary: This PR is the active candidate fix for the canonical guided CLI onboarding issue; related merged work solved adjacent Crestodian/macOS/providerless setup pieces but not this full CLI guided-default implementation.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🧂 unranked krab
Result: blocked by patch quality or review findings.

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

Rank-up moves:

  • Make detected env-key success leave a durable credential/ref or keep the verified first chat deliberately local.
  • Pass the selected workspace through classic verification and cover workspace-scoped provider/plugin discovery.
  • Persist the Codex ensure helper's returned config/install record before applying the model, then refresh the conflicted branch.

Risk before merge

  • [P1] Detected shell-only OpenAI/Anthropic keys can pass the guided live test but still be unavailable to the managed Gateway-backed first chat because the path persists model/workspace/gateway state without a durable credential/ref.
  • [P1] Classic wizard verification can false-fail workspace-scoped provider/plugin setups because it calls the verifier without the selected workspace.
  • [P1] Codex CLI guided setup can report success after installing the runtime plugin but lose the durable install metadata needed after restart.
  • [P1] The PR changes the public flagless interactive CLI onboarding default, so compatibility and product intent need maintainer acceptance even after the code blockers are fixed.
  • [P1] The branch is currently merge-conflicting and maintainers cannot modify the contributor branch, so the author must refresh it before normal landing.

Maintainer options:

  1. Fix setup correctness before merge (recommended)
    Require durable detected credentials or an explicitly local first-chat path, selected-workspace verification, persisted Codex install metadata, and a conflict refresh before landing.
  2. Accept the default-flow change deliberately
    Maintainers may accept the guided onboarding default after documenting the auth/provider upgrade posture and deciding the compatibility tradeoff is worth it.
  3. Pause for a narrower replacement
    If the default-flow change is too broad for this cycle, pause or close this PR and track only the live-verification repairs in smaller work.

Next step before merge

  • [P2] Needs author-side conflict refresh and maintainer product review before any repair or merge path; maintainers cannot modify the branch and the remaining blockers touch public onboarding/auth behavior.

Maintainer decision needed

  • Question: Should flagless interactive CLI onboarding switch from chat-first setup to this guided live-verification flow once the auth durability, workspace verification, Codex install-record, and conflict blockers are fixed?
  • Rationale: The code review can identify concrete blockers, but changing the default first-run CLI setup flow and fallback ladder is a public onboarding/product decision.
  • Likely owner: steipete — They own the canonical issue and the recent onboarding parity direction this PR implements.
  • Options:
    • Adopt guided default after blockers (recommended): Make guided live verification the default after the remaining auth/provider and workspace correctness blockers are fixed and the branch is refreshed.
    • Ship as opt-in first: Keep chat-first onboarding as the default and expose guided verification behind an explicit flag or command until maintainers collect broader proof.
    • Narrow to verification repair: Keep the current flow shape and only add live verification/failure handling to existing setup paths.

Security
Cleared: No dependency, workflow, release, or concrete secret-handling regression was found; the credential persistence problems are functional auth-provider blockers.

Review findings

  • [P1] Keep detected env keys available for first chat — src/commands/onboard-guided.ts:337-341
  • [P2] Verify classic setup in the selected workspace — src/wizard/setup.ts:67-69
  • [P2] Persist Codex install records after guided setup — src/crestodian/setup-inference.ts:627
Review details

Best possible solution:

Land the guided default only after detected credentials remain usable for first chat, classic verification uses the selected workspace, Codex ensure metadata is persisted, conflicts are refreshed, and the onboarding owner accepts the default-flow compatibility change.

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

Yes, source-reproducible: PR-head code shows the detected-env credential durability gap, selected-workspace verifier gap, and Codex install metadata loss. I did not run mutating onboarding tests in this read-only review.

Is this the best way to solve the issue?

No, not yet: reusing setup-inference is the right owner boundary, but this implementation still has auth/provider persistence blockers and needs maintainer acceptance of the default-flow change.

Full review comments:

  • [P1] Keep detected env keys available for first chat — src/commands/onboard-guided.ts:337-341
    Still unfixed from the prior review: a detected OPENAI_API_KEY or ANTHROPIC_API_KEY can pass the live test in this CLI process, but the success path persists only setup state and then opens the normal Gateway-backed TUI. If that key existed only in the shell, the managed Gateway does not have a durable credential/ref for the first real chat.
    Confidence: 0.9
  • [P2] Verify classic setup in the selected workspace — src/wizard/setup.ts:67-69
    Still unfixed from the prior review: the classic wizard passes workspaceDir into this helper, but the verification call drops it, so workspace-scoped provider/plugin models can be tested from a temp workspace and falsely fail.
    Confidence: 0.88
  • [P2] Persist Codex install records after guided setup — src/crestodian/setup-inference.ts:627
    This is a late finding on code already visible in the previous reviewed head. ensureCodexRuntimePluginForModelSelection returns a config containing any installed/repaired Codex plugin metadata, but this callback discards that config and only enables codex, so packaged Codex setup can lose the durable install record needed after restart.
    Confidence: 0.87
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.9

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1ad346e46509.

Label changes

Label justifications:

  • P0: The PR targets first-run CLI provider setup where a user can complete onboarding and still have no usable normal agent chat.
  • merge-risk: 🚨 compatibility: The diff changes the flagless interactive CLI onboarding default and classic setup verification behavior, both public setup workflow contracts.
  • merge-risk: 🚨 auth-provider: The diff changes provider detection, live verification, credential entry, runtime plugin install, and activation paths with remaining auth durability blockers.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🦞 diamond lobster and patch quality is 🧂 unranked krab.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (linked_artifact): Sufficient linked-artifact proof: the PR body and artifact URLs show after-change guided onboarding, manual masked key setup, classic verification, and channel/setup handoff flows; contributors should keep private keys, phone numbers, IPs, and endpoints redacted in any further proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient linked-artifact proof: the PR body and artifact URLs show after-change guided onboarding, manual masked key setup, classic verification, and channel/setup handoff flows; contributors should keep private keys, phone numbers, IPs, and endpoints redacted in any further proof.
Evidence reviewed

PR surface:

Source +1046, Tests +933, Docs +117. Total +2096 across 39 files.

View PR surface stats
Area Files Added Removed Net
Source 22 1116 70 +1046
Tests 12 943 10 +933
Docs 5 162 45 +117
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 39 2221 125 +2096

What I checked:

  • Live PR state requires maintainer handling: Live PR metadata shows the PR is open, has the protected maintainer label, is merge-conflicting, has maintainerCanModify: false, and closes the still-open canonical onboarding issue. (459b88a3a271)
  • Codex install metadata is discarded: At PR head, activateSetupInference calls ensureCodexRuntimePluginForModelSelection, but when it is required it writes only enablePluginInConfig(current, "codex").config, so any install metadata returned in ensured.cfg is lost. (src/crestodian/setup-inference.ts:627, 459b88a3a271)
  • Existing setup path preserves ensured config: The adjacent non-interactive provider setup path passes the selected model into the same Codex ensure helper and returns the helper's cfg, preserving install records and enablement together. (src/commands/onboard-non-interactive/local/auth-choice.plugin-providers.ts:262, 1ad346e46509)
  • Detected env-key path still opens normal chat after transient verification: The guided flow auto-tests credentialed detection candidates and treats a success as complete, then offers to launch the normal TUI; env-key candidates do not create manualAuth, so no durable credential is written before the managed Gateway-backed first chat. (src/commands/onboard-guided.ts:337, 459b88a3a271)
  • Classic verifier still ignores selected workspace: offerLiveModelVerification receives workspaceDir, but the verification call still passes only runtime; the verifier then builds the probe using temporary runtime state, so workspace-scoped providers can false-fail. (src/wizard/setup.ts:67, 459b88a3a271)
  • Late-finding continuity check: The Codex install-record code was already present in the earlier reviewed SHA, so the new Codex install finding is a late discovery rather than new code introduced after the prior cycle. (src/crestodian/setup-inference.ts:627, d46b2ad7485b)

Likely related people:

  • steipete: They authored the current PR, the canonical issue, and the merged conversational onboarding work that introduced the current CLI/Crestodian setup path. (role: feature owner and recent area contributor; confidence: high; commits: 07bf384a8b3f, 459b88a3a271; files: src/commands/onboard.ts, src/commands/onboard-guided.ts, src/crestodian/setup-inference.ts)
  • fuller-stack-dev: They authored the merged providerless Crestodian model-setup handoff PR touching the same Crestodian setup and masked provider onboarding surfaces. (role: recent adjacent contributor; confidence: medium; commits: 4e8498140236; files: src/crestodian/chat-engine.ts, src/crestodian/model-setup.ts, src/crestodian/operations.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.
Review history (4 earlier review cycles)
  • reviewed 2026-07-07T21:17:55.237Z sha f0342c4 :: found issues before merge. :: [P2] Regenerate the docs map
  • reviewed 2026-07-07T21:27:06.809Z sha f0342c4 :: needs changes before merge. :: [P1] Keep detected env keys available for first chat | [P2] Regenerate the docs map
  • reviewed 2026-07-08T03:29:47.386Z sha d46b2ad :: needs changes before merge. :: [P1] Preserve shell-detected keys for first chat | [P2] Regenerate the docs map
  • reviewed 2026-07-08T03:40:01.294Z sha d46b2ad :: found issues before merge. :: [P1] Persist detected env keys before first Gateway chat | [P2] Verify classic setup in the selected workspace

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f0342c4525

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/commands/onboard-guided.ts Outdated
deps.launchTui ??
(async () => {
const { launchTuiCli } = await import("../tui/tui-launch.js");
await launchTuiCli({ deliver: false });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep shell-env API keys available for first chat

When guided setup succeeds via a detected OPENAI_API_KEY/ANTHROPIC_API_KEY that exists only in the invoking shell, the live test runs in this CLI process and applyCrestodianSetup persists only the model/workspace/gateway. This branch then opens the normal Gateway-backed TUI instead of local mode; the managed Gateway service environment is rebuilt from durable .env/config/auth-profile refs, not arbitrary shell env, so the just-verified key is absent and the first chat fails. Manual pasted keys and keys already in the state .env are unaffected, but the common shell-export path needs either a durable credential/ref or a local TUI handoff.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jul 7, 2026
@openclaw-barnacle openclaw-barnacle Bot added the agents Agent runtime and tooling label Jul 8, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d46b2ad748

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/wizard/setup.ts
const verify = async () => {
const progress = params.prompter.progress(t("wizard.setup.testAiProgress"));
const result = await withConsoleSubsystemsSuppressed(() =>
verifySetupInference({ runtime: params.runtime }),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Verify classic setup in the selected workspace

When the classic wizard configures or keeps a model provided by an enabled workspace plugin, this call runs verifySetupInference without the selected workspaceDir. The preceding model/auth flow resolves provider choices with the real workspace, but the verifier then builds and runs its probe from a temporary workspace, so the provider plugin can be absent during the live check and the user gets a false failure with a prompt to “fix” an otherwise working config. Pass the selected workspace through to the verifier while keeping only session/auth scratch state temporary.

Useful? React with 👍 / 👎.

@openclaw-barnacle openclaw-barnacle Bot added the gateway Gateway runtime label Jul 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

await updateConfig((current) => enablePluginInConfig(current, "codex").config);

P2 Badge Persist Codex install records after guided setup

When Codex is the selected candidate on a packaged install that does not already have a codex install record, ensureCodexRuntimePluginForModelSelection installs @openclaw/codex and returns a config containing the new install metadata. This update discards that returned config and writes only enablePluginInConfig(current, "codex"), so the durable plugins.installs.codex record is never committed; after setup persists an openai/* default and the Gateway/process restarts, plugin discovery can no longer resolve the external Codex runtime even though onboarding reported success. Merge or persist ensured.cfg (at least its install record) before applying the model.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

steipete added 9 commits July 9, 2026 04:13
…assic fallback

Interactive `openclaw onboard` (and bare `openclaw` on a fresh install) now
runs a guided flow with macOS-app parity: detect existing AI access, live-test
candidates with a real completion before persisting anything, walk down the
ladder on failure with mapped reasons, and offer verified manual API-key entry
from installed provider manifests (masked input). In-flow escapes: classic
wizard, Crestodian chat, skip-AI. Classic wizard gains an optional post-auth
live verification step. `--classic`, `--modern`, and `--non-interactive`
contracts unchanged. Docs corrected for post-#99935 routing.

Closes #101851
…ck into classic escape

Candidate live-tests during guided setup are probes: rename their run id and
lane to the existing probe conventions (logging/subsystem.ts console
suppression, command-queue quiet probe lanes) so expected failures stop
leaking raw diagnostics into the Clack UI; file diagnostics unchanged. The
classic-wizard escape now passes the already-collected risk acknowledgement
through instead of re-prompting in the same session.
The live-test run enqueues on two lanes: the explicit probe lane and one
derived from its temp session key. Extend the shared quiet-probe predicate to
cover the derived lane so a failing candidate cannot leak lane-task
diagnostics into the wizard TTY.
…e tests

Provider-transport subsystem loggers (model-fetch start/response, transport
errors) carry no run id, so probe suppression cannot catch them and a failing
candidate printed raw log lines into the Clack TTY. Reuse the TUI console
subsystem-filter seam via a finally-safe scoped helper around guided
activation and the classic live-verify; file logging is unchanged and the
gateway (macOS app) surface is unaffected.
…ck fails

The re-run verification probe executes outside the configured workspace (setup
never runs workspace plugins), so a workspace-backed current model can fail
the check while working fine in the agent. Stop the auto ladder on an
existing-model failure and hand the decision to the manual stage instead of
silently persisting a different candidate as the default. Docs note the
fail-safe and the workspace caveat.
… wizards

From the chat, `open setup wizard`, `open classic wizard`, and `open channel
wizard for <channel>` hand off to the guided flow, the classic wizard, or the
masked `channels add` wizard after the chat TUI tears down (mirrors the
open-tui handoff; gateway surface gets a text pointer instead). The hosted
channel wizard no longer dead-ends at sensitive steps — it offers the switch
and remembers the channel. New read-only `channel info <channel>` operation
and ring-zero action surface label, blurb, configured state, and the real
docs URL from channel-setup discovery so the assistant can explain Slack or
Telegram prerequisites instead of guessing; both prompts instruct it to use
them. `channels add --channel <id>` now preselects the channel. Docs cover
the interchangeable flows.
…mpt guidance

Live test showed the agent detouring an explicit connect request through
channel_info because the guidance said to consult it first. Both prompts now
distinguish asking about a channel (channel info + docs link) from asking to
connect (connect right away).
The shared single-token prompt lacked sensitive:true, so terminal wizards
echoed pasted channel tokens and the Crestodian chat bridge (which refuses
plain-text secrets based on this flag) hosted the Telegram token step in
visible chat. Found live-testing the chat-to-wizard switch; pre-existing on
main but load-bearing for the masked-wizard contract this PR documents.
steipete added 4 commits July 9, 2026 04:19
Mirror the classic finalize handoff so the chat TUI never inherits the wizard
prompter's raw/paused terminal state on the default first-run path.
Engine-side surface gating already prevents open-setup replies on the gateway
surface; this keeps the client-visible action enum stable even if that gate
ever regresses. (Reviewed with the switching round; missed in its commit.)
@steipete
steipete force-pushed the claude/fervent-lehmann-5e5bce branch from 459b88a to 59100ae Compare July 9, 2026 11:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

await updateConfig((current) => enablePluginInConfig(current, "codex").config);

P2 Badge Preserve Codex install config when enabling the model

When guided onboarding reaches the Codex CLI path and ensureCodexRuntimePluginForModelSelection has to install or repair the runtime plugin, the returned ensured.cfg is the config that carries the plugin enablement plus durable install metadata produced by recordPluginInstall; this mutator discards that result and only enables codex on the current config. Unlike the sibling model setup paths that continue with codexInstall.cfg, a fresh Codex setup can save the openai/* default without the plugin install/trust/integrity record (or any non-recoverable install path), so the next process may need doctor/reinstall work before the selected runtime is actually available. Persist or merge ensured.cfg here instead of recomputing only enablePluginInConfig.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete
steipete merged commit e2a112a into main Jul 9, 2026
213 checks passed
@steipete
steipete deleted the claude/fervent-lehmann-5e5bce branch July 9, 2026 11:41
@steipete

steipete commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 10, 2026
…assic fallback (openclaw#101880)

* feat(onboard): guided CLI onboarding with live AI verification and classic fallback

Interactive `openclaw onboard` (and bare `openclaw` on a fresh install) now
runs a guided flow with macOS-app parity: detect existing AI access, live-test
candidates with a real completion before persisting anything, walk down the
ladder on failure with mapped reasons, and offer verified manual API-key entry
from installed provider manifests (masked input). In-flow escapes: classic
wizard, Crestodian chat, skip-AI. Classic wizard gains an optional post-auth
live verification step. `--classic`, `--modern`, and `--non-interactive`
contracts unchanged. Docs corrected for post-openclaw#99935 routing.

Closes openclaw#101851

* improve(onboard): quiet probe diagnostics in wizard TTY, carry risk ack into classic escape

Candidate live-tests during guided setup are probes: rename their run id and
lane to the existing probe conventions (logging/subsystem.ts console
suppression, command-queue quiet probe lanes) so expected failures stop
leaking raw diagnostics into the Clack UI; file diagnostics unchanged. The
classic-wizard escape now passes the already-collected risk acknowledgement
through instead of re-prompting in the same session.

* fix(onboard): quiet the session-derived setup-inference probe lane too

The live-test run enqueues on two lanes: the explicit probe lane and one
derived from its temp session key. Extend the shared quiet-probe predicate to
cover the derived lane so a failing candidate cannot leak lane-task
diagnostics into the wizard TTY.

* improve(onboard): suppress subsystem console output during wizard live tests

Provider-transport subsystem loggers (model-fetch start/response, transport
errors) carry no run id, so probe suppression cannot catch them and a failing
candidate printed raw log lines into the Clack TTY. Reuse the TUI console
subsystem-filter seam via a finally-safe scoped helper around guided
activation and the classic live-verify; file logging is unchanged and the
gateway (macOS app) surface is unaffected.

* fix(onboard): never auto-replace a configured model when its live check fails

The re-run verification probe executes outside the configured workspace (setup
never runs workspace plugins), so a workspace-backed current model can fail
the check while working fine in the agent. Stop the auto ladder on an
existing-model failure and hand the decision to the manual stage instead of
silently persisting a different candidate as the default. Docs note the
fail-safe and the workspace caveat.

* feat(onboard): two-way switching between Crestodian chat and the menu wizards

From the chat, `open setup wizard`, `open classic wizard`, and `open channel
wizard for <channel>` hand off to the guided flow, the classic wizard, or the
masked `channels add` wizard after the chat TUI tears down (mirrors the
open-tui handoff; gateway surface gets a text pointer instead). The hosted
channel wizard no longer dead-ends at sensitive steps — it offers the switch
and remembers the channel. New read-only `channel info <channel>` operation
and ring-zero action surface label, blurb, configured state, and the real
docs URL from channel-setup discovery so the assistant can explain Slack or
Telegram prerequisites instead of guessing; both prompts instruct it to use
them. `channels add --channel <id>` now preselects the channel. Docs cover
the interchangeable flows.

* fix(onboard): avoid param reassignment in open-setup handoff

* improve(onboard): separate ask-about vs connect intent in channel prompt guidance

Live test showed the agent detouring an explicit connect request through
channel_info because the guidance said to consult it first. Both prompts now
distinguish asking about a channel (channel info + docs link) from asking to
connect (connect right away).

* fix(channels): mark channel token entry as sensitive input

The shared single-token prompt lacked sensitive:true, so terminal wizards
echoed pasted channel tokens and the Crestodian chat bridge (which refuses
plain-text secrets based on this flag) hosted the Telegram token step in
visible chat. Found live-testing the chat-to-wizard switch; pre-existing on
main but load-bearing for the masked-wizard contract this PR documents.

* fix(onboard): restore terminal state around the guided flow's TUI launch

Mirror the classic finalize handoff so the chat TUI never inherits the wizard
prompter's raw/paused terminal state on the default first-run path.

* fix(channels): type the token prompter mock for the sensitive-flag assertion

* fix(gateway): map the TUI-only open-setup action to none for app clients

Engine-side surface gating already prevents open-setup replies on the gateway
surface; this keeps the client-visible action enum stable even if that gate
ever regresses. (Reviewed with the switching round; missed in its commit.)

* docs: regenerate docs map for onboarding page changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Guided CLI onboarding with live AI verification (macOS parity) and classic fallback

1 participant