Repository navigation
fix(macos): gate remote onboarding on gateway auth - #117904
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 7:09 AM ET / 11:09 UTC. ClawSweeper reviewWhat this changesThis PR gates macOS remote onboarding on a successful Gateway authentication probe and returns Gateway-auth failures to the connection page instead of misclassifying them as AI-provider setup failures. Merge readiness⛔ Blocked until stronger real behavior proof is added - 4 items remain Keep this PR open. It remains the active candidate fix for the linked macOS onboarding bug, and current Priority: P1 Review scores
Verification
How this fits togetherThe macOS onboarding wizard collects a remote Gateway endpoint and credential, then advances into configured-inference discovery and AI setup. This change places an authentication check at that connection boundary so later inference setup receives only a verified remote Gateway route or an actionable Gateway-auth failure. flowchart LR
A[Remote connection choices] --> B[Gateway credential probe]
B --> C{Authenticated and reachable?}
C -->|Yes| D[Configured inference check]
D --> E[Reuse Gateway AI or start AI setup]
C -->|No| F[Gateway auth guidance]
F --> A
Before merge
Agent review detailsSecurityNone. PR surfaceOther +631. Total +631 across 19 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Refresh this branch against current main and add redacted final-head native evidence showing that an unauthenticated remote Gateway remains on the connection page while a corrected credential can proceed into configured-inference reuse. Do we have a high-confidence way to reproduce the issue? Yes, with high confidence from source: current main has the remote connection probe but does not invoke it from the connection-page advance path, matching the fresh-onboarding reproduction described for v2026.7.1. This review did not execute the native macOS wizard. Is this the best way to solve the issue? Yes, provisionally. Gating progression at the Gateway boundary and preserving classified Gateway-auth failures is the narrowest owner-aligned repair; the remaining requirement is final-head native proof and integration refresh, not a different product design. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 55816c47d133. LabelsLabel 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 (6 earlier review cycles)
|
…mote-gateway-auth-gate # Conflicts: # apps/.i18n/native-source.json # apps/macos/Sources/OpenClaw/OnboardingAISetup.swift # apps/macos/Sources/OpenClaw/OnboardingView+Actions.swift
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
The requested final-head native capture is deferred for this landing pass. The PR body now documents the maintainer-hardware wizard verification at |
|
Merged via squash.
|
* fix(macos): gate remote onboarding on gateway auth * fix(macos): address onboarding CI failures * test(macos): stabilize gateway auth routing coverage * fix(macos): bound remote gateway onboarding probe * fix(macos): satisfy remote probe CI guards * fix(macos): scope remote probe cleanup ownership * refactor(macos): remove unused health snapshot wrapper
Closes #117903
What Problem This Solves
Fixes an issue where users selecting an authenticated remote Gateway during macOS onboarding could advance without the required Gateway token. The failure then surfaced one page later as a generic AI-accounts error, so users whose remote Gateway already had working AI configured were sent toward AI setup instead of Gateway-auth recovery.
Why This Change Was Made
The connection page now gates forward navigation on a successful probe for the exact transport, endpoint, and token input. Gateway-auth failures remain attached to the Gateway boundary, while the configured-AI preflight preserves those actionable failures instead of collapsing them into a provider-setup error. The probe and handoff paths share the same auth classification, and stale probe results cannot unlock changed connection inputs.
User Impact
Remote-onboarding users now get token, password, setup-code, or pairing guidance on the connection page before continuing. Once an authenticated remote Gateway reports configured inference, onboarding reuses it rather than asking the user to configure an AI account again.
Evidence
git diff --checkis clean.swift test --package-path apps/macos --parallelrun is blocked on this machine by the Xcode 27 beta 4 SwiftPM Sparkle test-bundle packaging limitation (dlopenrpath). Full proof is delegated to themacos-swiftCI lane on this PR's exact head SHA.Live behavior verification (maintainer hardware)
Before: With shipped 2026.7.1 and a pristine state directory, onboarding with a discovered remote gateway selected and no token advanced directly to “Connect your AI.” That page then failed with “Couldn't check this Mac for AI accounts — unauthorized: gateway token missing.” The remote gateway host's WebSocket log confirmed repeated, silent handshake failures with
reason=token_missingand close code 1008.After: A packaged branch build at
995da1830, using a fresh state directory and a real token-authenticated gateway, was exercised from the client Mac over both SSH-tunnel and direct WebSocket transports. Pressing Next with an unverified connection tuple did not advance. Instead, it showed “Checking remote gateway…” and kept the user on the gateway page with inline failure feedback. This was observed live for both a tunnel-preparation failure and a missing-token failure. Editing the token invalidated the recorded probe state and cancelled an in-flight probe, also observed live.The live run additionally exposed that the probe inherited the shared connection's 30-second connection timeout with three transport retries, taking roughly 125 seconds to reach a terminal state. Commit
d69238b6ffixes that behavior with a bounded 10-second probe timeout, no transport retries, and attempt-ID binding.RemoteGatewayProbeTestsand the onboarding suites cover the repair; all 117 tests passed in CI run 30743855408.The post-timeout-fix build was verified at the unit and CI level. The native-wizard verification described above was performed on the pre-timeout-fix branch build.
AI-assisted implementation and review.