Repository navigation
feat(onboarding): add Apple on-device setup and utility model - #150376
Conversation
|
🦞👀 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. |
|
Codex review: blocked before merge. Reviewed September 16, 2026, 11:37 PM ET / September 17, 2026, 03:37 UTC (Revision 7). ClawSweeper reviewWhat this changesAdds an Apple on-device provider for guided setup and utility tasks across CLI, browser, and Mac onboarding while preserving existing primary-model choices. Merge readiness⛔ Blocked before merge - 3 items remain The previous upgrade and recovery evidence blocker is resolved by the updated maintainer observations and unchanged runtime. No blocking defect was found in this re-review; the feature remains distinct from current main and protected from automated closure. Priority: P2 Review scores
Verification
How this fits togetherOnboarding discovers provider options, verifies the selected model, and saves its role in configuration. The setup assistant can use an explicit utility model before regular agent chat has a primary model. flowchart LR
A[CLI browser or Mac setup] --> B[Provider discovery]
B --> C[Apple availability and context check]
C --> D[Verify selected utility model]
D --> E[Configuration migration and save]
E --> F[Setup assistant]
E --> G[Preserved primary for regular chat]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain provider-owned Apple inference, shared utility-role handling, preserved primary routing, and the demonstrated full-archive recovery path. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: this adds a provider capability. The supplied observations exercise real Apple setup and published-version upgrade/recovery; this review ran no target code. Is this the best way to solve the issue? Yes. Apple-specific inference stays in its plugin, while generic setup metadata reuses the existing utility setting and preserves primary-model ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9a4468148bc0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
0a11d77 to
71f8441
Compare
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
Add a macOS-only setup option backed by the native Foundation Models API. Measure availability and context size, compile the helper during explicit setup, and keep tool execution and validation with OpenClaw. Cover native tool handoff, transcript continuation, constrained generation, platform selection, setup isolation, cancellation, and packaged asset roots. Refs #109228
Offer Apple Foundation Models only after a cancellable background probe confirms an available model with at least 8192 context tokens. Cold discovery compiles a disposable helper with installed Apple tools without installing inference or changing configuration; selection prepares the persistent helper and rechecks eligibility. Add detected-only auth-choice visibility for classic and app-guided setup. Keep unknown, unavailable, undersized, and stale configured routes out of offered choices while preserving explicit CLI selection and existing configuration. Validated 122 focused and native live tests, near-limit recall and over-limit rejection, built-plugin discovery, synthetic Control UI visibility and activation, runtime build, core/extension typechecks, targeted core lint, plugin lint, remaining changed-check guards, and independent P0-P2 review. Broad core lint also reports the unchanged pre-existing chat-pane-render.ts line-count violation.
Use the configured utility model for setup until a primary is selected, and keep Apple Foundation Models as an optional Mac setup and utility provider. Carry the model role through discovery, auth, activation, verification, and recovery across CLI, Control UI, and native Mac clients. Preserve existing primaries and exclude utility-only choices from implicit primary routing. Retain native tool constraints and validate structured results before publication. Keep helper repair available after updates and provide explicit setup-state facts to the small native model. Validation covers native Apple inference and tool replay, isolated onboarding, provider and agent ownership, aliases, recovery, generated protocols, build, TypeScript, lint, import cycles, and independent review. Native Mac UI tests remain pending the separate Xcode agreement; compile-only validation passed.
Preserve shipped implicit primary selection through the canonical config writer and Doctor before recording utility-model separation. Fresh utility setup stays without a primary. Pending or deferred legacy conversion is repaired before provider authentication, without relaxing credential or route-change guards. Retain dynamic catalog behavior, aliases and profiles, literal model suffixes, agent ownership, and deliberate provider/model removals. Move unchanged setup copy behind its existing lazy UI boundary and satisfy native formatting gates. Validation covers canonical writer and migration regressions, setup activation, provider effects, routing/readiness, type checks, lint, import boundaries, and signed native Mac onboarding/recovery tests. Independent review through P2 is clean; synthetic before/after screenshots render in the PR and originating chat.
584a041 to
029e064
Compare
|
@clawsweeper re-review The completed evidence is now in the PR body. The real published The rollback compatibility concern is also verified: a real published Real Apple production setup also passed with an 8,192-token model and complete setup inputs of 4,095–4,909 tokens. Final repair head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…aw#150376) * feat(apple-fm): offer on-device inference during Mac setup Add a macOS-only setup option backed by the native Foundation Models API. Measure availability and context size, compile the helper during explicit setup, and keep tool execution and validation with OpenClaw. Cover native tool handoff, transcript continuation, constrained generation, platform selection, setup isolation, cancellation, and packaged asset roots. Refs openclaw#109228 * fix(apple-fm): gate setup on background context detection Offer Apple Foundation Models only after a cancellable background probe confirms an available model with at least 8192 context tokens. Cold discovery compiles a disposable helper with installed Apple tools without installing inference or changing configuration; selection prepares the persistent helper and rechecks eligibility. Add detected-only auth-choice visibility for classic and app-guided setup. Keep unknown, unavailable, undersized, and stale configured routes out of offered choices while preserving explicit CLI selection and existing configuration. Validated 122 focused and native live tests, near-limit recall and over-limit rejection, built-plugin discovery, synthetic Control UI visibility and activation, runtime build, core/extension typechecks, targeted core lint, plugin lint, remaining changed-check guards, and independent P0-P2 review. Broad core lint also reports the unchanged pre-existing chat-pane-render.ts line-count violation. * fix(onboarding): keep utility inference separate from primary models Use the configured utility model for setup until a primary is selected, and keep Apple Foundation Models as an optional Mac setup and utility provider. Carry the model role through discovery, auth, activation, verification, and recovery across CLI, Control UI, and native Mac clients. Preserve existing primaries and exclude utility-only choices from implicit primary routing. Retain native tool constraints and validate structured results before publication. Keep helper repair available after updates and provide explicit setup-state facts to the small native model. Validation covers native Apple inference and tool replay, isolated onboarding, provider and agent ownership, aliases, recovery, generated protocols, build, TypeScript, lint, import cycles, and independent review. Native Mac UI tests remain pending the separate Xcode agreement; compile-only validation passed. * test(onboarding): drop retired activation diagnostics * fix(onboarding): preserve setup contracts across entry points * fix(onboarding): preserve legacy primary routes during utility setup Preserve shipped implicit primary selection through the canonical config writer and Doctor before recording utility-model separation. Fresh utility setup stays without a primary. Pending or deferred legacy conversion is repaired before provider authentication, without relaxing credential or route-change guards. Retain dynamic catalog behavior, aliases and profiles, literal model suffixes, agent ownership, and deliberate provider/model removals. Move unchanged setup copy behind its existing lazy UI boundary and satisfy native formatting gates. Validation covers canonical writer and migration regressions, setup activation, provider effects, routing/readiness, type checks, lint, import boundaries, and signed native Mac onboarding/recovery tests. Independent review through P2 is clean; synthetic before/after screenshots render in the PR and originating chat. * test(onboarding): align utility migration fixtures and wrapper closure
Related: #109228
What Problem This Solves
Mac users with Apple Intelligence need a local, key-free way to run guided setup without selecting the small on-device model as their regular agent model.
User Impact
On supported Gateway Macs, onboarding offers Apple Foundation Models after a cancellable background probe confirms an available model with at least 8,192 context tokens. Selection verifies and saves
apple-fm/systemasutilityModel, preserves existing primary models and credentials, and enables the setup assistant while a primary is still missing. Fresh setup leaves regular agent chat incomplete until a primary is selected; existing primary routing is preserved.Requires Apple silicon, macOS 27+, Apple Intelligence, and installed Apple developer tools with the macOS 27 SDK. Setup compiles the bundled native helper using those tools; it does not accept licenses or install developer tools automatically. The configured utility card provides Recheck & repair if that helper goes missing.
Why This Change Was Made
The provider owns native inference, model availability, tool-call handoff, and structured-result validation. Generic utility-role metadata carries the same selection through CLI, browser, and native Mac setup, authentication, verification, and recovery. Fresh utility selections are excluded from implicit primary fallback, including per-agent overrides and aliases. Older unmarked configs retain their shipped implicit primary. Doctor and normal config writes preserve that route before recording utility separation, honoring deliberate provider/model removal. Dynamic catalog IDs remain dynamic; pending or deferred conversion is repaired before utility provider authentication. Literal catalog IDs containing
@stay on the structured model-selection path.The model is intended for focused setup and short utility calls. Long prompts and full activity-recap batches can exceed even 8K; output quality and schema compliance remain limited. Invalid structured results are rejected before publication. This PR keeps the 8K discovery/activation gate; it does not enable the older 4K model.
Evidence
Real Apple on-device inference passed on
029e064ce547through production setup verification, session creation, and system-agent turns. The native context was 8,192 tokens; complete setup inputs measured 4,095–4,909 tokens. The model successfully called agent listing, config schema, and config read tools, then correctly explained that regular chat still needs a primary model. The cold background probe completed in 3.606 seconds while the event loop continued; isolated configuration remained unchanged.Real 4K model on macOS 26.6.2: the first full setup request was rejected at 4,943 tokens against a 4,096-token limit. Short utility requests generated responses, though title brevity was unreliable. A full recap exceeded both model windows.
Migration, canonical writer, provider pre-effect, credential activation, alias/agent ownership, route/readiness, dynamic environment, literal model suffix, and deliberate-removal regressions passed. Selected type, lint, schema, import, and platform checks completed. Independent review through P2 is clean.
Developer ID-signed native Mac proof passed 14 unique tests across four suites (38 parameterized cases / 43 invocations) in a disposable macOS 26.6.2 VM with initialized Xcode 26.5. All onboarding source bytes are unchanged by the rebase; incoming main changed only an unrelated optional plugin-inspection protocol field and Node dependency inputs. Both VMs and their isolated image cache were cleaned up. The final macOS CI lane passed.
UI performance passed on
029e064ce547against9ce12dfa6125, with Node 24.21.0, Vite 8.2.2, and Pako 3.0.1: 362,409 gzip bytes across seven startup JavaScript requests, 179 bytes below the unchanged enforcement threshold. CSS was unchanged.The actual published
[email protected]updater installed the canonically packaged029e064ce547candidate successfully (all 11 steps, 58.5 seconds). Legacy direct and alias/profile utility routes retained their ordinary primary through startup, Doctor, unrelated config writes, and restarts. Five ordinary agent turns made six requests to a synthetic loopback model. Fresh utility-only setup retained no primary and remained incomplete for regular chat. Isolated upgrade run. A second published-driver cell confirmed both implicit and explicit per-agent primaries, utility aliases, and fallbacks through upgrade, Doctor, config write, and restart.Recovery passed with the matching published
2026.9.4package and an archive created by its realbackup create --verifycommand before upgrade. The old reader correctly rejected the candidate marker. Its realbackup restorerestored the original config hash exactly and both per-agent databases from schema 21 to 19; the old Gateway then started and both agents produced successful ordinary replies. The updater-created.pre-updateconfig copy also matched the original bytes. This is supported verified archive recovery, not automatic package rollback; package downgrade alone cannot reverse newer state.Final repair head
f49442e9d1a7changes only test fixtures and the trusted-wrapper extraction manifest relative to the029e064ce547live-proof artifact; all application runtime inputs are unchanged. The repair passed independent P2 review, selected type/lint/guard checks, and focused system-agent tests. Exact-head CI passed, including iOS smoke, macOS Swift tests, Windows, and real-Gateway UI E2E. All 331 applicable maintainer-tooling cases passed, including native APFS cold/warm and sparse provisioning; two platform cases skipped. Seven cold-allocation cases initially hit the host disk reserve and passed unchanged after task-only space recovery.Synthetic browser fixtures show the earlier generic-model presentation and the new explicit setup/utility role. These captures contain no operator data.
Before
After
Configured utility helper repair
Before: the configured utility card had no repair action.
After: Recheck & repair rebuilds and verifies the utility route while preserving primary-model state.
Signed native Mac setup proof
The same synthetic fixture was rendered by signed native test bundles in a disposable VM. The before capture is the earlier development state at
dbdbafccc045; the after capture includes this PR's explicit setup/utility presentation. These are UI fixtures, not an Apple inference run on the VM.Before
After