Repository navigation
fix: show why AI provider setup failed and let it be run again - #2393
Fly-onlyone wants to merge 1 commit into
Conversation
When the Gateway settles a provider wizard with an error and no activation rejection, Companion showed only "The setup outcome is not confirmed" and then could not leave that state: wizard.cancel and wizard.next answer "wizard not found" because the Gateway purges a settled session. - Raise the Gateway's own error text for a settled error, so the dialog shows the cause (for example "Claude CLI was not found on PATH"). - On Check again or Cancel, read the saved setup back instead of calling the purged session. When setup was incomplete before the attempt and still is, no route was promoted and the attempt is released as rejected. An attempt made while a route was already configured stays uncertain. - Accept the Gateway's canonical receipt for its Claude CLI runtime: the candidate is offered as "claude-cli/<model>" and saved as "anthropic/<model>". Every other route must still match exactly. Related: openclaw#2112
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Codex review: needs real behavior proof before merge. What this changesThis PR exposes provider setup errors, permits retry after selected first-run failures, and recognizes Claude CLI’s canonical activation receipt. Example: Claude CLI is missing during first-run provider setup.
Review scores
ProductKind: Bug fix · Worth it: Needs a maintainer decision · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this PR addresses failures still present on main, but its read-back-based retry policy needs an owner decision. Reviewed head: Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherGatewayAiSetupClient translates authenticated Gateway discovery and wizard responses into setup-page state, recovery actions, and exact-model verification. flowchart LR
A[Provider setup page] --> B[GatewayAiSetupClient]
B --> C[Authenticated Gateway transport]
C --> D[Gateway wizard runner]
D --> E[Provider and saved configuration]
C --> F[Setup discovery and verification]
F --> B
Technical reviewBest possible solution: Keep diagnostics and Claude receipt normalization in the existing client, with recovery release governed by an agreed Gateway contract. Do we have a high-confidence way to reproduce the issue? Main retains the generic terminal-error exception and exact-string receipt comparison; the report and inspected before screenshots corroborate both failures. Is this the best way to solve the issue? The diagnostic and receipt fixes use the right owner, while treating saved-state absence as rejection changes the existing recovery contract. Full review comments:
Overall correctness: patch is correct AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1cd641de9195. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 28, 2026, 10:13 AM ET / 15:13 UTC. |
Related: #2112
What Problem This Solves
When an AI provider step fails inside the Gateway during Companion setup, three things go wrong today:
claude) was not found on PATH") is only in the Gateway log.User Impact
User impact: a failed provider step now says why it failed, and "Check again" or "Cancel" returns to the provider choices on a first-run setup so the step can be tried again. The detected "Claude Code" choice now completes instead of ending in "a different model".
Scope limits to keep visible:
Why This Change Was Made
All three are in
GatewayAiSetupClient.status: "error"and no acceptedactivationRejectionkeepsPhase = Uncertain, because the Gateway schema says such an error can follow committed writes and that "the top-level error retains their detail". The client now raises thaterrortext instead of a fixed sentence. The page already sanitizes the detail and caps it at 2048 characters.done: trueresult only after its runner has settled, and purges the wizard session before it responds (wizard.nextinsrc/gateway/server-methods/wizard.ts).wizard.nextandwizard.cancelfor that session can therefore only answer "wizard not found". For that one case, Refresh and Cancel now readopenclaw.setup.detectinstead. If setup was incomplete before the attempt and still is, no route was promoted and the attempt becomesRejected. Anything else staysUncertainand is never replayed. Lost replies, non-terminal sessions,status: "done"without a receipt, and an unknown rejection disposition all keep today's behavior.claude-cliwith modelclaude-cli/<model>and saves it asanthropic/<model>(setup-inference-activate.ts, caseclaude-cli). The Gateway's web client adopts the receipt's model; the Windows client compared strings. Exactly that one mapping is now accepted. Every other route must still match exactly.The earlier review on #2112 recommended restoring diagnostics first and treating retry separately. The cause text is that part. The release is the part that needs maintainer judgment: it relies on the settled-session ordering above plus an authoritative read, not on the absence of a receipt. I am happy to split it into its own PR if that is easier to review.
Evidence
Real behavior proof. Clean Hyper-V guest restored from a checkpoint for each pass, Windows 11 Pro 26H2 build 26300.9974, Gateway
OpenClawFoundation.OpenClawGateway_2026.11.11081.0installed by Companion setup from the Store (isolated session). Unsigned local installers fromscripts\build-inno-local.ps1 -Arch x64 -FastwithRequireSignedCleanupHost=false.The "after" screenshots come from one build that contains this PR and #2394 (feat: use your existing Claude Code sign-in with an isolated native Gateway) together (installer sha256
986A70A7...2E21BE22, base8d31176d). The detected "Claude Code" choice only appears when Claude Code exists in the Gateway's agent account, which that other change provides.8d31176d: generic sentence only.Regression tests. Each new behavior test was seen failing without the product change.
SettledErrorWithoutRejection_ReportsGatewayCauseWithoutReleasingTheAttempt: failed withExpected: "Claude CLI was not found on PATH..." Actual: "Setup ended without an authoritative acti...".SettledErrorWithUnchangedSavedSetup_IsReleasedWithoutReachingThePurgedSession(Refresh and Cancel): released toRejected, nowizard.cancel, no furtherwizard.next, and a second start is allowed.Uncertain: saved setup changed, a route was already configured (same model name), the read-back fails,status: "done"without receipt, unknown rejection disposition.CliRuntimeCandidate_AcceptsItsCanonicalProviderReceiptAndVerifiesThatRoute, plus four receipts that must still be refused (other model, other provider forclaude-cli, a kind-named provider that is not Claude CLI,anthropic/for a non Claude kind).SettledErrorWithoutRejection_ShowsGatewayCauseWithoutCompletionOrAutomaticRetryandSettledErrorWithoutRejection_CheckAgainReleasesTheAttemptForAnExplicitRetry.Validation at head
7e5a6a31(this branch alone, clean tree, Windows 11 x64):./build.ps1dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restoredotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --no-restore --filter "(FullyQualifiedName~OnboardingAiPageTests|FullyQualifiedName~NativeSharedFlowTests)&<CI lane category exclusions>"Independent review. A separate review agent read the diff and its owners twice. Its findings led to two narrowings now in this PR: the receipt mapping is limited to
claude-clitoanthropic, and the release applies only while setup is incomplete.Not verified / blocked
NativeOnboardingProof) and accessibility test categories were not run.openclaw config set gateway.nodes.commands.allow ...) was sometimes refused by the Gateway CLI with "Gateway lock owner identity could not be verified. No local mutation was attempted." A direct test showed the same refusal 2 times out of 10 in the first minute after a Gateway restart, with none of this PR's code involved. It is not addressed here.Required proof pools
windows-winui-interactive: the AI setup dialog's error detail and its recovery behavior changed. Current-head screenshots from a clean Windows 11 guest are under Evidence.