Skip to content

fix(macos): gate remote onboarding on gateway auth - #117904

Merged
steipete merged 8 commits into
mainfrom
fix/mac-onboarding-remote-gateway-auth-gate
Aug 2, 2026
Merged

steipete merged 8 commits into
mainfrom
fix/mac-onboarding-remote-gateway-auth-gate

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Added focused coverage for remote-navigation gating, exact-input probe invalidation, Gateway-auth classification, configured-Gateway auth handoff, and the existing AI-setup path.
  • Structured autoreview completed clean with no accepted or actionable findings.
  • git diff --check is clean.
  • The focused local swift test --package-path apps/macos --parallel run is blocked on this machine by the Xcode 27 beta 4 SwiftPM Sparkle test-bundle packaging limitation (dlopen rpath). Full proof is delegated to the macos-swift CI lane on this PR's exact head SHA.
  • Native screenshots are omitted because reproducing the affected UI state requires fresh-machine onboarding; the redacted maintainer-hardware observations are documented below.

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_missing and 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 d69238b6f fixes that behavior with a bounded 10-second probe timeout, no transport retries, and attempt-ID binding. RemoteGatewayProbeTests and 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.

@steipete
steipete marked this pull request as ready for review August 2, 2026 08:11
@openclaw-barnacle openclaw-barnacle Bot added app: macos App: macos size: L maintainer Maintainer-authored PR labels Aug 2, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 7:09 AM ET / 11:09 UTC.

ClawSweeper review

What this changes

This 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 main still lets the connection-page Next path advance without the new Gateway-auth probe. The patch has focused source and test coverage plus green macOS CI, but final-head native behavior proof is still insufficient because the documented live wizard run predates the timeout/attempt-binding refinement at the current head.

Priority: P1
Reviewed head: d69238b6fd8cc0ad0ffce361bc578a3344ad754b

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The repair is focused and well-covered, but the current head lacks real native proof for its final timeout refinement.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: The PR body gives specific redacted native observations for the central gate at pre-head commit 995da1830, but the current-head timeout and attempt-binding change has only unit and CI evidence; add redacted final-head native output or diagnostics before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: The PR body gives specific redacted native observations for the central gate at pre-head commit 995da1830, but the current-head timeout and attempt-binding change has only unit and CI evidence; add redacted final-head native output or diagnostics before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 5 items Current-main gap: Current main still exposes probeRemoteConnection() as a manual connection check while its onboarding action path has no remote-auth advance decision; the PR adds that decision before page advancement.
Canonical gate on PR head: The proposed connection-page probe captures the exact transport, endpoint, and token input, binds a probe attempt ID, and only advances after a matching successful result.
Decision and regression coverage: The branch makes remote onboarding advancement conditional on a matching verified probe and adds tests for target, transport, and token edits invalidating a prior success.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: The PR body gives specific redacted native observations for the central gate at pre-head commit 995da1830, but the current-head timeout and attempt-binding change has only unit and CI evidence; add redacted final-head native output or diagnostics before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The documented native wizard verification is from pre-head commit 995da1830; the later 10-second timeout and attempt-binding behavior at d69238b6 lacks final-head native output or a redacted diagnostic trace.
  • Resolve merge risk (P1) - The PR is behind a current-main macOS onboarding rewrite that touched the same area; GitHub reports it cleanly mergeable, but maintainers should refresh the exact integration before landing.
  • Complete next step (P2) - This protected maintainer-labeled PR needs a human merge decision after final-head native proof and current-main integration refresh; there is no narrow repair-lane defect to dispatch.
Agent review details

Security

None.

PR surface

Other +631. Total +631 across 19 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 19 866 235 +631
Total 19 866 235 +631

Review metrics

None.

Stored data model

Persistent data-model change detected: serialized state: apps/macos/Tests/OpenClawIPCTests/RemoteGatewayProbeTests.swift. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #117903
Summary: This PR is the active candidate fix for the canonical macOS remote-onboarding authentication bug.

Members:

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

Merge-risk options

Maintainer options:

  1. Capture final-head native proof (recommended)
    Before merging, show a redacted final-head macOS run for the missing-token and corrected-token paths, including the bounded terminal failure behavior.
  2. Accept the remaining proof gap
    A maintainer may merge based on focused tests and CI while explicitly accepting that the final timeout refinement lacks native-wizard evidence.

Technical review

Best 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.

Labels

Label justifications:

  • P1: This repairs a broken first-run remote Gateway workflow that can send users to the wrong credential-recovery step.
  • merge-risk: 🚨 auth-provider: The patch changes when remote Gateway token, password, setup-code, and paired-device authentication outcomes permit onboarding to advance.
  • 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 stronger real behavior proof before merge: The PR body gives specific redacted native observations for the central gate at pre-head commit 995da1830, but the current-head timeout and attempt-binding change has only unit and CI evidence; add redacted final-head native output or diagnostics before merge. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main history shows Peter Steinberger carrying the recent macOS onboarding handoff, and this PR's current implementation and linked bug fix are in the same remote-onboarding boundary. (role: recent area contributor; confidence: high; commits: 76cb418b6f2c, d69238b6fd8c; files: apps/macos/Sources/OpenClaw/OnboardingView+Pages.swift, apps/macos/Sources/OpenClaw/OnboardingView+Layout.swift, apps/macos/Sources/OpenClaw/RemoteGatewayProbe.swift)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add redacted final-head macOS onboarding evidence for missing credentials, corrected credentials, and the bounded probe failure path.
  • Refresh the branch against current main and re-check the exact merge result.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • 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.

History

Review history (6 earlier review cycles)
  • reviewed 2026-08-02T08:30:54.940Z sha 0e86a78 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T08:47:22.992Z sha 995da18 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T10:08:00.407Z sha 4c92d8c :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T10:28:43.636Z sha 66daff7 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T10:35:34.321Z sha d69238b :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-02T11:03:33.647Z sha d69238b :: needs real behavior proof before merge. :: none

…mote-gateway-auth-gate

# Conflicts:
#	apps/.i18n/native-source.json
#	apps/macos/Sources/OpenClaw/OnboardingAISetup.swift
#	apps/macos/Sources/OpenClaw/OnboardingView+Actions.swift
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. label Aug 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 2, 2026
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 2, 2026
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

The requested final-head native capture is deferred for this landing pass. The PR body now documents the maintainer-hardware wizard verification at 995da1830 and states explicitly that the later timeout and attempt-ID refinement at d69238b6f was verified at the unit and CI level. The live verification already demonstrates that the unverified tuple stays on the gateway page, surfaces inline failures, and is invalidated when the token changes. The repo-native prepare flow will refresh the exact integration against current main before merge.

@steipete
steipete merged commit 2472782 into main Aug 2, 2026
107 of 111 checks passed
@steipete
steipete deleted the fix/mac-onboarding-remote-gateway-auth-gate branch August 2, 2026 11:14
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL 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.

[Bug]: macOS onboarding advances past unauthenticated remote gateway

1 participant