Skip to content

feat(macos): start fresh installs in guided dashboard setup - #169568

Merged
steipete merged 12 commits into
mainfrom
steipete/mac-zero-config-first-run
Oct 12, 2026
Merged

steipete merged 12 commits into
mainfrom
steipete/mac-zero-config-first-run

Conversation

@steipete

@steipete steipete commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A fresh Mac install currently requires several native setup pages before reaching OpenClaw, and the custodian cannot explain an automatically selected AI connection.

User Impact

Fresh installations with no prior onboarding, saved connection, config, or Gateway profile immediately show native setup progress while preparing the bundled runtime, starting their own local Gateway, and opening custodian onboarding. The same window offers Set up manually, retires pending dashboard navigation when cancelled, becomes the existing recovery page on failure, and closes after the dashboard is ready. They never join a discovered Gateway. Runtime, connection, authentication, and dashboard failures return to the relevant native page with an error. Existing and remote setups retain their current behavior.

The Control UI shows deterministic progress and a dismissible setup summary, with provider alternatives, ChatGPT sign-in, and manual recovery. Native shells can expose Gateway selection, permissions, and AI setup through a shared capability interface. The existing custodian greeting starts after automatic setup succeeds.

Dependency: this PR depends on the companion openclaw.setup.auto PR from lane auto; the lead will rebase it after that PR lands. The method is feature-detected, with the existing manual behavior when absent. This PR does not implement the Gateway method. Rebased onto origin/main at f466872e035bb50add50e8e0a4ca85e6965567ef, including the Bun pin and current Solid custodian surface. The lead will integrate the dependency after it lands.

Why This Change Was Made

Native startup reuses the CLI installer, bundled runtime, Gateway activation, and dashboard owners. Onboarding is marked seen only after the existing shell-ready signal confirms the requested dashboard route. The native AI picker remains available for manual recovery. The UI keeps selection in the Gateway, reuses the existing auth wizard and activation RPC, and ignores results from an old connection. Route rendering waits for its onboarding data, preventing an early caretaker greeting during boot.

Release-note context: fresh Mac installs enter guided dashboard setup automatically; the custodian explains its selected AI and offers alternatives or sign-in while preserving manual recovery.

Native capability contract (Mac and Tauri)

ui/src/app/native-setup.ts owns NativeSetupCapability. A shell may install window.__OPENCLAW_NATIVE_SETUP__ before UI boot, exposing only supported callbacks:

{
  currentGateway?: { name: string; kind: "local" | "remote" },
  openAiSetup?: () => void,
  openGateways?: () => void,
  reviewPermissions?: () => void
}

name is the shell's display label, including its local-device name. The shared fallback for an unnamed local Gateway is This computer; macOS supplies localized This Mac through its Gateway snapshot. The card detects individual capabilities and has no WebKit dependency. Each callback delegates authority and effects to the host's existing owner.

For the existing device-settings adapter, capabilities.aiSetupAvailable: true explicitly advertises AI setup. The Mac host publishes it; iOS omits it and retains the terminal fallback. The card observes snapshot updates. The Mac adapter maps AI setup to device settings { type: "open", panel: "ai-setup" }, Gateway selection to the existing gateways { type: "open-settings" } message, and permissions to the existing device-permissions route. ai-setup opens the native AI page without marking onboarding complete. Tauri can implement these callbacks through its existing { type: "open", panel: "ai-setup" | "gateways" | "permissions" } messages. Browser-only recovery shows openclaw onboard.

Evidence

Current revision, after the main rebase:

  • First-run coordinator: 5 tests / 9 cases, 0.006 s test time / 0.33 s wall in an isolated Swift Testing executable. Verifies each progress step appears before its operation, all failure routes, cancellation, and completion only after dashboard readiness.
  • Native product and all test targets compiled: 88.87 s initial build and 116.10 s after cancellation recovery. The new gated HTTP cancellation regression is compiled for disposable native CI; it was not run on the operator desktop. A failed/cancelled document wait retires its navigation and closes its window only while the originating intent remains current. Pure tests deny operator files, preferences, Keychain, network, and child processes. App-linked tests were compiled only on this desktop.
  • UI boundary: 21 tests passed, 12.74 s wrapper wall. Covers local shell labels, every setup card state, activation/sign-in/retry/dismissal and stale connections, plus route loading. The two label regression cases failed before the fix.
  • Mock-Gateway browser: 5 E2E cases passed, 75.82 s including production UI build and fresh screenshots. Confirms the card and greeting gate on the current Solid surface. Uses store completion signals and Solid flushing, with no test sleeps or new timing races.
  • UI typecheck (7.67 s incremental), focused lint, native SwiftLint/SwiftFormat, locale generators/verifiers, protocol, config docs, plugin inventory, and applicable baseline ratchets passed. The custom subscriber getter produces an advisory reactivity lint warning; its subscription is covered by the UI tests.
  • Full branch LOC versus the rebase base: production +1088/−44, tests +795/−2, docs +49/−39, generated locale inventories +17/−0. Review revisions: production +285/−188 (mostly moving the existing card into a named Solid component), tests +80/−6.

Earlier boundary proof remains recorded on the prior head: 181 UI tests, the isolated seven-test native panel contract suite, and broader native compilation. No real Gateway or packaged app was launched. The lead owns signed packaged first-run/recovery, launch timing, and published-driver upgrade proof after companion integration. Operator state, the installed app, and LaunchAgents were untouched.

The native screenshots below render the actual production SwiftUI progress view offscreen. The browser screenshots use the production Control UI and synthetic mock-Gateway fixtures. All full captures were inspected before upload.

Native startup progress

Previously fresh startup displayed no window during preparation. It now presents this same native window through runtime preparation, Gateway startup, and dashboard loading:

Preparing the local runtime

Gateway and dashboard progress

Starting the Gateway

Opening the dashboard

Before

Before: existing custodian onboarding

After: selected AI

Configured AI summary

Progress, alternatives, sign-in, and recovery states

Connecting your AI

Activation failure preserves the selection

Alternative activated

ChatGPT sign-in required

Existing sign-in wizard

Browser recovery

Native recovery

Remaining integration/proof hold: the lead must land the automatic-inference dependency and run signed packaged first-run/recovery and published-driver upgrade proof preserving saved local/remote settings. No persisted data schema changes are introduced here.

Independent branch autoreview is clean through P2 on 44ee1b29398324014a839dc5a9b6c3ec84a2f845. The accepted cancellation finding was fixed before the single revision push. Post-push check: ClawSweeper still reports the previous head (744b0e58); no review of this head is available yet. CI preflight failed in “Detect changed scopes” because the original branch included two generated Localizable.xcstrings entries alongside source edits. The next integration must discard that file's two-line generated delta while retaining apps/.i18n/native-source.json; the native locale workflow owns publication. The requested one revision push is complete, so this small correction is recorded for the lead's next integration. Companion integration and packaged native proof remain lead-owned.

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: ios App: ios app: macos App: macos app: web-ui App: web-ui size: XL labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR starts fresh Mac installations with native progress followed by guided dashboard AI setup and manual recovery.

Example: Launch OpenClaw.app without configuration, saved Gateways, or previous onboarding.

  • Before: The user completes native connection, runtime, and AI selection pages.
  • After: The app prepares a local Gateway and, when the companion RPC is available, opens dashboard setup with an AI summary and recovery controls.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation is coherent and has no identified code defect, but integration and packaged runtime validation remain incomplete.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Fresh Mac users must complete several native setup pages before reaching OpenClaw and receive no dashboard explanation of automatic AI selection.
Reason: The maintainer-authored direction reduces setup friction through existing owners and retains explicit alternatives and recovery.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep this PR open: it provides useful, maintainer-directed onboarding work absent from main, and the previous generated-translation finding is fixed.

Priority: P2
Reviewed head: 2bc29687b6cfc9424a75b44236f69528edc2359a

Before merge

  • Resolve merge risk - Integrate the companion Gateway implementation before merging so fresh installations can reach the advertised automatic dashboard setup flow.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Provide signed packaged first-run, cancellation/recovery, and published-release upgrade evidence with saved local and remote settings preserved; baseline failures are reported only for the label regressions.
Agent review details

How this fits together

The macOS first-run coordinator delegates runtime and Gateway startup to existing native owners, then hands off to the Control UI, which requests Gateway-owned inference setup.

flowchart LR
  A[Fresh Mac launch] --> B[First-run coordinator]
  B --> C[Runtime and Gateway owners]
  C --> D[Dashboard readiness]
  D --> E[Control UI setup card]
  E --> F[Gateway inference setup]
  B --> G[Native manual recovery]
  E --> G
Loading

Technical review

Best possible solution:

Ship native first-run orchestration and Gateway-owned inference setup together while preserving saved connections and manual recovery.

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

This is a feature request implemented as a PR; current-main source confirms the existing native onboarding path, and no target code was executed during this review.

Is this the best way to solve the issue?

The implementation appropriately reuses runtime, Gateway activation, dashboard navigation, and authentication owners while keeping provider selection on the Gateway.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6d79ee9dd27c.

Merge-risk options

Maintainer options:

  1. Hold for companion integration (recommended)
    Keep this PR open until the Gateway RPC lands, then integrate its final contract before merging.

Provenance checked

  • Explicit AI selection changes intended behavior with a stated reason (64bf824: Detection was made passive so opening native onboarding would not select or test a provider without a click.)
  • Web-first native navigation keeps the original intent (cba8118: One navigation owner consistently selects the web or experimental native experience while retaining device-local native setup.)
  • Custodian connection ownership keeps the original intent (aeee426: Stable sessions and connection-owned convergence preserve ongoing setup across reconnects without introducing another Gateway state owner.)
  • Dashboard readiness keeps the original intent (0d2bc80: Native commands wait for the current trusted dashboard listener and reject stale document readiness.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +1059, Tests +793, Docs +10. Total +1862 across 37 files. Added test files: 3.

View PR surface stats
Area Files Added Removed Net
Source 26 1105 46 +1059
Tests 9 795 2 +793
Docs 2 49 39 +10
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 37 1949 87 +1862

Review metrics

Metric Value Why it matters
Native bridge extension 1 panel and 1 optional capability Adds the ai-setup panel and aiSetupAvailable advertisement; macOS exposes it and iOS retains unsupported-panel handling.

Labels

Label changes:

  • add merge-risk: 🚨 other: Incomplete companion integration would ship documentation for automatic dashboard AI setup while fresh installations still fall back to native AI selection.
  • remove status: ⏳ waiting on author: Current PR status no longer selects a status label.

Label justifications:

  • P2: This improves first-run setup ergonomics without establishing an urgent existing-user regression.
  • merge-risk: 🚨 other: Incomplete companion integration would ship documentation for automatic dashboard AI setup while fresh installations still fall back to native AI selection.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (8 earlier review cycles)
  • reviewed 2026-10-12T03:23:51.454Z sha 81eaed6 :: blocked before merge. :: [P2] Regenerate the native localization inventory from the final Swift paths
  • reviewed 2026-10-12T04:40:14.012Z sha adc9182 :: blocked before merge. :: [P2] Add AI setup to the native panel contract test
  • reviewed 2026-10-12T04:56:37.066Z sha adc9182 :: blocked before merge. :: [P2] Add AI setup to the native panel contract test
  • reviewed 2026-10-12T05:29:45.710Z sha 744b0e5 :: blocked before merge. :: none
  • reviewed 2026-10-12T05:38:16.518Z sha 744b0e5 :: blocked before merge. :: none
  • reviewed 2026-10-12T06:01:56.971Z sha 744b0e5 :: blocked before merge. :: none
  • reviewed 2026-10-12T07:11:50.595Z sha 44ee1b2 :: blocked before merge. :: none
  • reviewed 2026-10-12T07:23:49.609Z sha 44ee1b2 :: blocked before merge. :: [P2] Remove generated native translations from the source change

Reviewed October 12, 2026, 2:43 PM ET / 18:43 UTC (Revision 9).

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Oct 12, 2026
@steipete
steipete marked this pull request as ready for review October 12, 2026 04:43
@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. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. label Oct 12, 2026
@steipete
steipete force-pushed the steipete/mac-zero-config-first-run branch from 744b0e5 to 44ee1b2 Compare October 12, 2026 07:01
@clawsweeper clawsweeper Bot added merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 12, 2026
@steipete
steipete merged commit ec7fec0 into main Oct 12, 2026
88 checks passed
@steipete
steipete deleted the steipete/mac-zero-config-first-run branch October 12, 2026 19:59
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 12, 2026
## What Problem This Solves

The Dashboard cancellation test introduced in `ec7fec0636d38748b2205a0a117233441e8b1f2c` (#169568) assumes that returning from native cancellation means WebKit has already published `isLoading = false`. Native teardown calls `stopLoading()`, but the test does not await that asynchronous state change. The assertion failed in [scheduled CI 38305224828](https://github.com/openclaw/openclaw/actions/runs/38305224828/job/114997825068) and again in validation run 38306200884.

## User Impact

The regression test waits for WebKit's actual stopped-loading state while preserving cancellation, window cleanup, and pending-navigation checks. This changes one test file, +27/−10 lines, with no production change, sleep, polling, or increased deadline.

## Why This Change Was Made

Observe the existing loading-state notification with `AsyncTestSignal` while the fixture's HTTP response remains blocked. Keep the response gated until loading stops so ordinary completion cannot satisfy the cancellation check, and reject failure-page completion. Invalidate the observation on exit; on errors, cancel and join the opening task and release the response gate.

## Evidence

- Native CI [38311910220, job 115019805962](https://github.com/openclaw/openclaw/actions/runs/38311910220/job/115019805962), head `0c4b38b77adfcd32fc25a18f5d0ed7fb97c2faae`: the exact cancellation target passed in 7.770 seconds; `DashboardExperienceTests` passed all six tests (nine cases) in 132.289 seconds. The default native invocation passed all 2,505 tests in 282 suites in 551.058 seconds. These are actual Dashboard target and suite results.
- Candidate `1efe4806e7ae5beb46ede6a3c40b48e7356d86da` contains the exact reviewed and tested Dashboard source. Native owners, relevant fixture/wait helpers, Swift package dependencies, test runner, Swift configurations, and CI workflow match the passing composition and audited main `012fa012eb6ef3708a6d09a9104b48e784f8327a`. Main still has the unchanged test preimage. The composition also contained a separate MLX test repair; its full native pass is not claimed as an exact-candidate full-suite run.
- Pinned SwiftFormat and focused SwiftLint passed with zero violations on the same test source and configuration. Whitespace checks, normal commit hooks, and one isolated Codex review passed with no actionable findings.
- Exact-candidate [CI 38309523531](https://github.com/openclaw/openclaw/actions/runs/38309523531) completed successfully, but native and static jobs were skipped. Native compilation/runtime and focused Swift static proof are qualified separately above; skipped checks are not claimed as passing. No new local native runtime was run for this qualification.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
…#169568)

* feat(macos): start fresh installs in guided dashboard setup

* fix(macos): reset onboarding page state for manual recovery

* chore(ui): refresh setup card localization inventory

* chore(ui): tighten setup card static checks

* fix(ios): retain unsupported setup panel handling

* fix(ui): advertise only supported native AI setup actions

* chore(macos): refresh native localization inventory

* test(macos): cover native AI setup panel contract

* fix(macos): show first-run setup progress immediately

* fix(macos): retire cancelled dashboard setup navigation

* fix(ui): simplify guarded onboarding route values
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
)

## What Problem This Solves

The Dashboard cancellation test introduced in `30559a4d18d31b87d49e84697df358dbf082752e` (openclaw#169568) assumes that returning from native cancellation means WebKit has already published `isLoading = false`. Native teardown calls `stopLoading()`, but the test does not await that asynchronous state change. The assertion failed in [scheduled CI 38305224828](https://github.com/openclaw/openclaw/actions/runs/38305224828/job/114997825068) and again in validation run 38306200884.

## User Impact

The regression test waits for WebKit's actual stopped-loading state while preserving cancellation, window cleanup, and pending-navigation checks. This changes one test file, +27/−10 lines, with no production change, sleep, polling, or increased deadline.

## Why This Change Was Made

Observe the existing loading-state notification with `AsyncTestSignal` while the fixture's HTTP response remains blocked. Keep the response gated until loading stops so ordinary completion cannot satisfy the cancellation check, and reject failure-page completion. Invalidate the observation on exit; on errors, cancel and join the opening task and release the response gate.

## Evidence

- Native CI [38311910220, job 115019805962](https://github.com/openclaw/openclaw/actions/runs/38311910220/job/115019805962), head `0c4b38b77adfcd32fc25a18f5d0ed7fb97c2faae`: the exact cancellation target passed in 7.770 seconds; `DashboardExperienceTests` passed all six tests (nine cases) in 132.289 seconds. The default native invocation passed all 2,505 tests in 282 suites in 551.058 seconds. These are actual Dashboard target and suite results.
- Candidate `1efe4806e7ae5beb46ede6a3c40b48e7356d86da` contains the exact reviewed and tested Dashboard source. Native owners, relevant fixture/wait helpers, Swift package dependencies, test runner, Swift configurations, and CI workflow match the passing composition and audited main `57a1e1ef0cd47249a4fb3e610b2a19b723ae92c9`. Main still has the unchanged test preimage. The composition also contained a separate MLX test repair; its full native pass is not claimed as an exact-candidate full-suite run.
- Pinned SwiftFormat and focused SwiftLint passed with zero violations on the same test source and configuration. Whitespace checks, normal commit hooks, and one isolated Codex review passed with no actionable findings.
- Exact-candidate [CI 38309523531](https://github.com/openclaw/openclaw/actions/runs/38309523531) completed successfully, but native and static jobs were skipped. Native compilation/runtime and focused Swift static proof are qualified separately above; skipped checks are not claimed as passing. No new local native runtime was run for this qualification.
RomneyDa added a commit that referenced this pull request Oct 16, 2026
Backport of 1ed40a1 (partial: startup-config-preflight native bootstrap initialization before webhook history reads, its regression test, the source-captures test isolation, and the database-schemas doc note; skipped the admitStateSchemaFacts catalog-reuse refactor (not required on this branch), the macOS OnboardingFirstRun readiness-waiter change (OnboardingFirstRun from #169568 is main-only), and the Telegram e2e catalog isolation).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: ios App: ios app: macos App: macos app: web-ui App: web-ui docs Improvements or additions to documentation merge-risk: 🚨 other 🚨 Merging this PR has meaningful risk outside the owned taxonomy. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant