Skip to content

feat(onboarding): add Apple on-device setup and utility model - #150376

Merged
steipete merged 7 commits into
mainfrom
codex/apple-foundation-model-setup
Sep 17, 2026
Merged

steipete merged 7 commits into
mainfrom
codex/apple-foundation-model-setup

Conversation

@steipete

@steipete steipete commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

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/system as utilityModel, 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 029e064ce547 through 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 029e064ce547 against 9ce12dfa6125, 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 packaged 029e064ce547 candidate 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.4 package and an archive created by its real backup create --verify command before upgrade. The old reader correctly rejected the candidate marker. Its real backup restore restored 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-update config 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 f49442e9d1a7 changes only test fixtures and the trusted-wrapper extraction manifest relative to the 029e064ce547 live-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

Before: Apple shown as a general model

After

After: Apple explicitly marked for setup and utility

Configured utility helper repair

Before: the configured utility card had no repair action.

Before helper repair action

After: Recheck & repair rebuilds and verifies the utility route while preserving primary-model state.

After helper repair action

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

Native Mac setup before

After

Native Mac setup and utility after

@clawsweeper

clawsweeper Bot commented Sep 16, 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: macos App: macos app: web-ui App: web-ui gateway Gateway runtime commands Command implementations agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Sep 16, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 16, 2026, 11:37 PM ET / September 17, 2026, 03:37 UTC (Revision 7).

ClawSweeper review

What this changes

Adds 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
Reviewed head: f49442e9d1a7323c1772e3f1d0369a242acebc01

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent implementation with strong platform and upgrade observations and no remaining actionable finding from this re-review.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): Recorded real Apple setup verification and system-agent turns exercise the changed provider and utility routing; completed published-updater and archive-restoration observations address the previous compatibility blocker. Runtime bytes match the tested revision. Inspected browser fixtures supplement presentation proof; blocked raw-log access is a reviewer limitation.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): Recorded real Apple setup verification and system-agent turns exercise the changed provider and utility routing; completed published-updater and archive-restoration observations address the previous compatibility blocker. Runtime bytes match the tested revision. Inspected browser fixtures supplement presentation proof; blocked raw-log access is a reviewer limitation.
Evidence reviewed 11 items Runtime unchanged since previous review: The comparison identifies only ten test files and the wrapper extraction manifest as changed since the live-tested revision. GitHub's exact commit patches confirm fixture migration markers, preserved assertions, and wrapper dependencies. A local full patch read encountered a missing historical blob; the read-only GitHub commit endpoint supplied the patches.
Previous primary preservation: The migration derives legacy primary selection from the previous configuration, preserves explicit selections and fallbacks, honors removed provider rows, and defers dynamic or ambiguous values. The canonical writer supplies the authored previous source.
Persistence regression coverage: Reviewed tests exercise fresh and existing configuration writes, included files, deliberate removals, dynamic environment references, and the registered Doctor migration. These tests were inspected, not executed in this read-only review.
Findings None None.
Security None None.

How this fits together

Onboarding 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]
Loading

Before merge

  • Resolve merge risk (P1) - Package-only downgrade to v2026.9.4 cannot read the new utility-separation marker; recovery depends on retaining and restoring the verified pre-upgrade archive.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production +2,841 lines; tests and test support +4,295 lines Excluding docs, metadata, tooling, and generated Swift protocol output, growth supports the native provider, shared role handling, and migration coverage described in the PR.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/system-agent/setup-inference-credentials.ts, migration/backfill/repair: src/system-agent/setup-model-selection.ts, unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Retain the verified recovery contract (recommended)
    Proceed with the documented utility-role migration and full-archive restoration boundary, preserving the explicit warning that package downgrade alone is insufficient.

Technical review

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Recorded real Apple setup verification and system-agent turns exercise the changed provider and utility routing; completed published-updater and archive-restoration observations address the previous compatibility blocker. Runtime bytes match the tested revision. Inspected browser fixtures supplement presentation proof; blocked raw-log access is a reviewer limitation.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a bounded optional onboarding improvement with measured platform requirements.
  • merge-risk: 🚨 compatibility: The patch expands provider setup metadata and persists a migration marker that requires archive restoration when returning to the older release.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit. Replaced prior rating: 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): Recorded real Apple setup verification and system-agent turns exercise the changed provider and utility routing; completed published-updater and archive-restoration observations address the previous compatibility blocker. Runtime bytes match the tested revision. Inspected browser fixtures supplement presentation proof; blocked raw-log access is a reviewer limitation.
  • proof: sufficient: Contributor real behavior proof is sufficient. Recorded real Apple setup verification and system-agent turns exercise the changed provider and utility routing; completed published-updater and archive-restoration observations address the previous compatibility blocker. Runtime bytes match the tested revision. Inspected browser fixtures supplement presentation proof; blocked raw-log access is a reviewer limitation.

Evidence

What I checked:

  • Runtime unchanged since previous review: The comparison identifies only ten test files and the wrapper extraction manifest as changed since the live-tested revision. GitHub's exact commit patches confirm fixture migration markers, preserved assertions, and wrapper dependencies. A local full patch read encountered a missing historical blob; the read-only GitHub commit endpoint supplied the patches. (scripts/pr-lib/wrapper-components.txt:189, f49442e9d1a7)
  • Previous primary preservation: The migration derives legacy primary selection from the previous configuration, preserves explicit selections and fallbacks, honors removed provider rows, and defers dynamic or ambiguous values. The canonical writer supplies the authored previous source. (src/config/utility-model-separation-migration.ts:130, f49442e9d1a7)
  • Persistence regression coverage: Reviewed tests exercise fresh and existing configuration writes, included files, deliberate removals, dynamic environment references, and the registered Doctor migration. These tests were inspected, not executed in this read-only review. (src/config/utility-model-separation-migration.io.test.ts:46, f49442e9d1a7)
  • Completed upgrade and recovery observations: The captured PR body and feat(onboarding): add Apple on-device setup and utility model #150376 (comment) report completed published-2026.9.4 updater cells preserving default and per-agent primaries, aliases, fallbacks, restarts, and ordinary replies. Published backup restoration recovered the original configuration hash and working old-version agent databases. This directly addresses the previous rank-up request; package-only downgrade is expressly excluded. (029e064ce547)
  • Production Apple behavior: The captured body records production setup verification, session creation, and system-agent tool turns with an 8,192-token native model and 4,095–4,909-token complete inputs. This exercises the plugin's native transport and setup routing, rather than merely application startup or fixture rendering. (extensions/apple-fm/setup.ts:56, 029e064ce547)
  • Inspected browser presentation: Inspected all four prepared images: the before/after discovery pair visibly changes Apple from a general model to setup/utility, and the configured-card pair adds Recheck & repair. These synthetic captures establish presentation only; runtime conclusions use the separately recorded production observations. The native image pair was not included in the prepared manifest. (ui/src/pages/model-setup/configured-model.ts:21, f49442e9d1a7)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-09-16T23:39:05.610Z sha 0a11d772ad43ee02d24c7a3e92c3c5004e0cdea9 :: blocked before merge. :: [P1] Preserve shipped implicit primary routes during upgrade
  • reviewed 2026-09-16T23:57:53.415Z sha 71f8441839627a0c133c14cf48256dd526c5470a :: blocked before merge. :: [P1] [P1] Preserve shipped implicit primary routes during upgrade
  • reviewed 2026-09-17T00:18:55.320Z sha 7522c35a203d9d7e0824ffefb5b9b60f289570d2 :: blocked before merge. :: [P1] [P1] Preserve shipped implicit primary routes during upgrade
  • reviewed 2026-09-17T01:36:13.279Z sha 7522c35a203d9d7e0824ffefb5b9b60f289570d2 :: blocked before merge. :: [P1] [P1] Preserve shipped implicit primary routes during upgrade
  • reviewed 2026-09-17T02:31:41.482Z sha 584a041d80a40e5615a6c755f5f5a52af6eb7bf9 :: blocked before merge. :: none
  • reviewed 2026-09-17T03:08:45.349Z sha 029e064 :: blocked before merge. :: none

@steipete
steipete force-pushed the codex/apple-foundation-model-setup branch from 0a11d77 to 71f8441 Compare September 16, 2026 23:48
@steipete
steipete marked this pull request as ready for review September 16, 2026 23:49
@steipete
steipete requested a review from a team as a code owner September 16, 2026 23:49
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • extensions/apple-fm/package.json
  • pnpm-lock.yaml

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfiles or workspace dependency policy changes are present.
  • Treat pnpm-lock.yaml and package-lock.json diffs as dependency security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Sep 16, 2026
@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes noted

This PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin, a member of @openclaw/openclaw-secops, or an OpenClaw organization member with Maintain or Admin repository access.

  • Current SHA: f49442e9d1a7323c1772e3f1d0369a242acebc01
  • Trusted actor: @steipete
  • Trusted role: pull request author; openclaw-secops

Security review is still recommended before merge when the dependency graph change is intentional.

@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Sep 17, 2026
@steipete steipete self-assigned this Sep 17, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 17, 2026
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.
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@steipete
steipete force-pushed the codex/apple-foundation-model-setup branch from 584a041 to 029e064 Compare September 17, 2026 02:32
@openclaw-barnacle openclaw-barnacle Bot added the cli CLI command changes label Sep 17, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The completed evidence is now in the PR body. The real published 2026.9.4 updater installed the exact 029e064ce547 candidate and preserved default and per-agent ordinary primaries, utility aliases, and fallbacks through Doctor, unrelated config writes, and restarts. Fresh utility-only setup retained no ordinary primary.

The rollback compatibility concern is also verified: a real published backup create --verify archive restored through published backup restore returned the original config bytes and both agent databases to their published schema. The matching old Gateway then started and served successful ordinary requests for both agents. The old package correctly rejected the candidate marker before restoration. This proves the documented full-archive recovery path; it does not claim package-only downgrade or automatic rollback across migrated state.

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 f49442e9d1a7 only updates test fixtures and maintainer-wrapper extraction; application runtime bytes match the live-tested 029e064ce547 artifact. Exact-head CI is running.

@clawsweeper

clawsweeper Bot commented Sep 17, 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 exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 0352277 into main Sep 17, 2026
244 checks passed
@steipete
steipete deleted the codex/apple-foundation-model-setup branch September 17, 2026 03:53
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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

Labels

agents Agent runtime and tooling app: macos App: macos app: web-ui App: web-ui cli CLI command changes commands Command implementations dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant