Repository navigation
fix(linux): first-run desktop onboarding automatically connects working AI - #129211
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
80a56af to
fd7f865
Compare
|
Codex review: found issues before merge. Reviewed August 25, 2026, 7:21 AM ET / 11:21 UTC. ClawSweeper reviewWhat this changesThe PR sends Linux desktop first runs through automatic model verification and selectively copies eligible provider API keys into the managed Gateway service. Regression provenancePossible regression — suspected (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open: the latest head fixes the prior stale-key reclassification case but drops a newly supplied replacement key when it has the same provider environment-variable name as the retired managed key. Priority: P1 Review scores
Verification
How this fits togetherThe Linux Tauri companion installs a local Gateway and opens its Control UI. The installer decides which desktop credentials can enter the systemd service, then Model Setup verifies inference before onboarding or chat. flowchart LR
A[Desktop launch environment] --> B[Gateway service installer]
B --> C[Credential ownership decision]
C --> D[Systemd environment file]
D --> E[Gateway bootstrap cleanup]
E --> F[Model Setup verification]
F --> G[Onboarding or chat]
Decision needed
Why: The diff changes credential ownership across the desktop, installer, and systemd boundary; the current behavior can silently remove a newly rotated credential on repair. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +397, Tests +801, Docs +6, Other +7. Total +1211 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the retirement rule for an unchanged inherited managed value, but adopt a different current shell value for that same eligible provider as a new file-backed operator credential and cover that exact reinstall path. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: remove the config SecretRef, retain the old managed OPENAI_API_KEY in the service, then rerun repair with a different shell OPENAI_API_KEY; the current merge and candidate filters omit it. Is this the best way to solve the issue? No: the stale-key fix is incomplete because ownership is decided only by key name rather than whether the current shell value is a new replacement credential. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8166cc01b94d. LabelsLabel changes:
Label 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 (3 earlier review cycles)
|
|
@clawsweeper re-review The latest head fixes a real Linux first-run failure found with the native desktop and a live OpenAI key: ambient provider credentials remain protected in the systemd environment file but are correctly classified as operator-owned, so Gateway pre-bootstrap no longer removes them as stale managed dotenv values. Focused owner-boundary regressions, stale-secret cleanup, credential migration, and plugin trust restrictions pass. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The latest head directly resolves the previous P1: existing managed provider credentials are never reclassified as operator-owned after their configuration SecretRef is removed. The new owner-boundary regression first failed against the previous head, then passed after deleting the migration path: the retired managed OpenAI key is absent while a genuinely fresh Anthropic operator key remains protected and file-backed. All 148 focused daemon/Gateway bootstrap tests pass, stale-secret cleanup remains intact, and the PR now includes public-safe screenshots showing real automatic OpenAI onboarding plus an actual assistant chat response. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review The latest head resolves both previous P1 findings together. A table-driven owner-boundary regression first failed for same-provider rotation, then passed after distinguishing unchanged inherited managed values from deliberately changed current shell values: an unchanged retired OpenAI key is removed, a rotated OpenAI replacement remains operator-owned and file-backed, and an unrelated fresh Anthropic key still works. All 149 focused daemon/Gateway bootstrap tests pass, stale-secret cleanup remains intact, and public-safe screenshots show real automatic OpenAI onboarding plus an actual assistant chat response. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…ng AI (openclaw#129211) * fix(linux): make desktop AI onboarding work automatically * fix(linux): harden provider ownership and onboarding lifecycle * test(ui): document partial onboarding context fixture * fix(linux): preserve operator-owned onboarding API keys * fix(linux): retire previously managed provider credentials * fix(linux): retain rotated onboarding provider credentials
Related #106337
Follows #128614
Builds on #108977
What Problem This Solves
Fixes an issue where Linux desktop users installing OpenClaw for the first time landed in onboarding without working AI access. Provider API keys present when launching the desktop app were lost at the systemd service boundary, and available model credentials were never automatically verified or activated.
Why This Change Was Made
The native companion now routes first installation directly to Model Setup. A dedicated first-run owner verifies an existing model or attempts detected, credentialed provider routes in Gateway order, only falls through definitive failures, and continues to guided onboarding after a verified activation. Restart-required activation waits for the replacement Gateway and verifies the exact committed model before continuing.
Linux Gateway installation accepts provider-declared, app-guided inference API keys only from bundled or independently verified official plugins and keeps them in owner-only systemd environment files. Crucially, genuinely new shell-provided keys remain operator-owned instead of being mislabeled as managed dotenv values: Gateway pre-bootstrap correctly removes stale managed dotenv credentials, so misclassifying a first-install provider key silently deleted it before detection. Removing an existing configuration-owned key's SecretRef retires the unchanged credential, while a genuinely different same-provider replacement supplied by the operator remains safely file-backed. Durable, operator-owned, and auth-profile-owned credentials retain their existing precedence and survive reinstalls.
User Impact
A Linux desktop launch with an available supported provider API key can finish AI setup automatically and enter guided onboarding with working inference. Existing configured models are live-verified before entering chat. Failed or unavailable setup remains visible and actionable; unrelated GitHub tokens, provider admin credentials, OAuth secrets, and keys requested by enabled third-party plugins are not copied into the Gateway service.
Evidence
f404ac61fdc34e238649749814f358f38b5ca664was canonically built and run on a real Linux/XFCE desktop using the actual native Tauri/WebKit application and a real OpenAI API key. The managed CLI reported(f404ac6); the systemd Gateway was active;gateway.systemd.envhad mode0600and contained the provider credential without classifying it as a managed dotenv key. Existing configuration-owned credentials remain retired while deliberately rotated same-provider replacements survive./settings/model-setup?firstRun=1to/custodian?onboarding=1without selecting a provider or entering a credential. Actual Gateway logs recorded successfulopenclaw.setup.detectfollowed byopenclaw.setup.activate; the live OpenAI Responses API independently returned HTTP 200 and model output. On exact final head, the real app automatically detected the configured OpenAI model, displayedChecking — asking openai/gpt-5.6-sol for a quick reply…, completedopenclaw.setup.verifyin 2565 ms, and navigated to/chat/mainshowingInference is ready.andVerified model: openai/gpt-5.6-sol.ChoosingTalk to my agentopened real chat, where the live assistant replied exactlyLINUX_ONBOARDING_OK.Before: real Linux desktop after a clean install
The baseline reaches Model Setup, but the desktop process's available OpenAI credential is missing from the managed Gateway and setup stalls on unrelated local-model choices.
After: real native Linux desktop with automatically verified OpenAI inference
The actual Tauri/WebKit window reaches guided onboarding automatically and reports the live verified model without manual provider selection or API-key entry.
Live chat after onboarding
The same real Linux desktop handed off to the normal agent and completed an actual OpenAI-backed user-to-assistant chat round trip.