Repository navigation
refactor(macos): move app settings into the Dashboard and keep Connection native - #138092
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. |
028d562 to
46f6991
Compare
|
Codex review: blocked before merge. Reviewed September 5, 2026, 2:59 PM ET / 18:59 UTC. ClawSweeper reviewWhat this changesMoves macOS app settings into the embedded Dashboard through a native bridge, retains an offline Connection window, and removes retired settings panes and supporting code. Merge readiness⛔ Blocked before merge - 6 items remain This PR remains useful: current main still contains the native settings window. The inspected source addresses the prior consent and lifecycle findings; the remaining review limitation concerns access to the captured proof addendum, not a newly identified code defect. Priority: P2 Review scores
Verification
How this fits togetherThe macOS app embeds the Gateway’s Dashboard. Dashboard settings requests pass through a native bridge to existing Mac preference and permission owners, which return the settled state to the page. flowchart TD
A[Dashboard settings] --> B[Native message bridge]
B --> C[Validate document and session]
C --> D[Native consent when required]
D --> E[Revalidate scope and lifetime]
E --> F[Mac preference and permission owners]
F --> G[Settled Dashboard snapshot]
H[Offline Connection window] --> A
Decision needed
Why: The settings-write and lifecycle evidence is available, but the captured addendum is omitted and network retrieval failed; this requires someone with evidence access, not an automatic request for contributor rework. 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: Keep one Dashboard settings surface backed by existing native owners, with coordinated app/Gateway upgrades, offline Connection recovery, and verified consent-to-effect coverage. Do we have a high-confidence way to reproduce the issue? Not applicable to the overall refactor. Prior consent failures have concrete native regression scenarios, but this read-only review did not execute them. Is this the best way to solve the issue? Yes, the inspected design consolidates duplicate settings UI while preserving native preference, permission, and offline recovery owners; the remaining evidence-access decision is separate from that architectural fit. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against ac53dc9687ca. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (25 earlier review cycles; latest 8 shown)
|
d95f8c8 to
41d2e85
Compare
41d2e85 to
d920a62
Compare
…shboard settings Require native consent before sharing idle/activity presence with the Gateway and keep app-local settings guidance available in the offline Connection window (PR #138092).
|
Rank-up moves from the 12:47 UTC review:
|
…shboard settings Require native consent before sharing idle/activity presence with the Gateway and keep app-local settings guidance available in the offline Connection window (PR #138092).
d920a62 to
16d3a1c
Compare
Route the surviving progress card directly through ChatMarkdownRenderer and remove unused skill update and construction helpers left behind by the native settings retirement. The shared iOS/macOS Periphery intersection now has no findings.
Cancel the device-settings queue and native consent when WebKit commits a replacement document or the manager transfers the window to a new controller. Use NSWindow.close for manager teardown so a modal sheet cannot disable the close operation and skip the existing windowWillClose cleanup. The real AppKit regression failed for replacement, committed navigation, and close before this change; all four cases now pass in an isolated macOS VM. The complete 22-test Dashboard window ownership suite also passes. Replace the failing iOS Watch settlement test's busy-yield waits with buffered receipt and warning callbacks, retaining the two-second deadline and every settlement, sibling-send, and no-replay assertion. Exact-head iOS CI must verify that fixture repair in the original suite order. Validation: both native builds, 24 focused tests, strict Periphery with no findings, Swift lint/format, native localization, docs checks, and Codex P2 review pass. Document consent retirement and remove a duplicated docs paragraph.
Keep the six Dock icon designs introduced on main reachable after retiring General Settings. Advertise the existing native preference and available artwork through the device bridge, and render the acknowledged selection in This Mac. Remove the retired SwiftUI picker and its unused helpers. Validate the native enum and artwork at the owner, preserve older host snapshots, and cover parser, page, and browser request/acknowledgement flows.
Select the retained Connection health render by its current Swift Testing identifier, preserving the sandbox and all five required image artifacts. Suspend the Watch route-lease and reconnect fixtures on their existing send/receipt callbacks instead of polling MainActor work. Preserve the two-second deadlines and every journal, command, text, and no-replay check. Hosted macOS tests passed 1,983 cases before the stale render selector failed. The adjacent iOS lease fixture exposed the remaining polling race; local strict-concurrency receipt proof and P2 review pass. A fresh hosted run will verify the original iOS suite order and actual health rendering.
Use WebKit's per-message replies to return canonical native state after consent, including Cancel and normalized values. Settle only the matching pending draft before notifying the current Dashboard page; preserve newer edits and reject requests from retired documents. Extend native WebKit lifecycle and browser coverage for cancellation, normalization, delayed replies, and navigation. Keep the coordinated Dashboard upgrade contract and existing capability owners.
Start the held-roster browser fixture on New Session so default-enabled Swarm child hydration cannot be mistaken for a duplicate canonical request. Keep every exact dashboard and roster count, late-reply assertion, and per-tab refresh check, and assert the initial canonical query explicitly.
Commit permission completion only for the current enablement intent and requesting Dashboard document. Keep persistence and runtime refresh in the existing property observer, removing premature writes and duplicate refresh tasks. Add cancellation regression coverage and reuse the existing Compose-aware waiter in the Android settings fixture exposed by hosted CI. Native builds, focused tests, strict Periphery, localization, full changed-file checks, Android fixture proof, and P2 review pass.
Reuse the native selected-language recognition policy in device snapshots. Keep the Dashboard explanation and allow an already-enabled setting to be turned off. Preserve interactive voice controls. The existing Talk regression fails before repair and all 53 cases pass after; native builds, Periphery, localization, changed-file checks, and P2 review pass.
Wait for each architecture fixture to report installed signal handlers before requesting cancellation, and join the launcher through the existing Mac test fixture lifetime before deleting its inputs. Preserve the fifteen-second test deadline and existing outcome, assembly, process, and lock assertions. The full changed gate reproduced the former one-second expect.poll readiness race; explicit readiness events avoid a startup-speed dependency.
Revalidate the scope shown by native consent immediately before synchronous device settings writes. A domain revoked from another Dashboard window cannot be restored by an older Allow response. Preserve canonical snapshot replies and the Voice Wake/location permission owners.
Device settings requests now require a current, valid browser session lease, so a renewal that revokes the lease before WebKit cleanup replaces the document cannot let a stale page write settings. Dashboard failure copy points at the Connection window, and the lifecycle test waits for the real dashboard document on lease-backed loads.
The Voice Wake fence commit carried a readability-only change to an Android UI test; keep this PR scoped to the Mac and Dashboard settings surfaces.
|
Merged via squash.
|
Related: #115999 (native/dashboard ownership doctrine), #137971 (Control UI half of this change)
Land after #137971. This PR removes the native settings surface; the Dashboard pages it points to ship in #137971 with the Gateway.
What Problem This Solves
The macOS app has two settings surfaces. The native Settings window owns General, Permissions, Voice & Talk, Updates and a set of "legacy" gateway panes (Channels, Skills, Cron Jobs, Threads, Instances) that were handed off to the Dashboard in #115999 but never deleted and kept receiving fixes; the Dashboard owns everything else. Users have to know which window holds which setting, the native panes drift from the Dashboard as it evolves, and app-local settings such as voice-wake trigger words are unreachable from any browser.
Why This Change Was Made
This completes the #115999 decision: native owns device-local capability, the Dashboard owns settings UI. The native Settings window is removed. Device-local capability is exposed to the Control UI through a new WKWebView bridge (
openclawDeviceSettings, contract owned byui/src/app/native-device-settings.tsfrom #137971): the app publishes a validated snapshot of app preferences, capabilities, browser import and cookie-sync state, all eight macOS permission statuses, voice settings, and updater state, and appliesset/request-permission/open-system-settings/open/check-for-updatesmessages through the same native owners the panes used (never by writingopenclaw.json). Enabling capabilities that let a Gateway act on or export data from this Mac (cookie sync and its domains/profile, Computer Control, Peekaboo Bridge, camera) requires a native confirmation sheet, because origin trust on the dashboard page is not user intent.What stays native, deliberately: a small Connection window (Connection tab with mode, remote/SSH, Tailscale and discovery; Gateways tab with saved profiles; Debug tab while the developer toggle is on) because it must work when the Gateway is unreachable; the standard macOS About panel; and the bridge-opened panels (Quick Chat shortcut recorder, microphone tester with live meter, browser-login import). Settings… (⌘,) and the status menu's Settings… open the Dashboard's Settings; the status menu gains Connection…; the dashboard failure page gains "Connection Settings…". Exec approvals for this Mac need no bridge: the Devices page already edits them through
exec.approvals.node.*, which shares the node's SQLite store with the app.apps/macos/AGENTS.mdrecords the doctrine so it stops living only in a PR body. Platform docs are updated to the new locations.User Impact
One settings surface. In the Mac app, Dashboard → Settings gains a This Mac group (This Mac, Permissions) and This Mac sections on Talk and Updates; the native Settings window and its fifteen tabs are gone. Connection… remains available from the status menu, the app menu, and the dashboard failure page. About OpenClaw shows the standard About panel. Nothing changes for browsers, iOS, or other platforms.
Net production change: about −11.4k lines of Swift.
Evidence
Before (native Settings window, baseline build of
main, isolatedbeforeprofile):After (this branch's app under an isolated
afterprofile, direct remote mode to a dev gateway serving the #137971 Control UI):Live test notes: the app connected as a paired node and UI client to the dev gateway, the This Mac pages rendered real snapshot data (shortcut ⌥Space, granted/undetermined TCC statuses), Connection… opened the native window on both tabs, About opened the standard panel. Found and fixed during the live test: the Talk page's primary language fell back to the first option because the published primary locale id was not in the available list (system-default marker); the snapshot now always publishes a member id.
Local proof (native SwiftPM with the packaging flags):
swift build --build-system native -c debug --product OpenClawandswift build --build-system native --build-testsgreen.swift test --filter 'DeviceSettingsBridgeTests|ConnectionWindowTests|CronModelsTests|DeviceSettingsRequestQueueTests'andDashboardRouteMapTestsin OpenClawKit.scripts/lint-swift.sh macos,scripts/format-swift.sh macos,pnpm native:i18n:verify,pnpm test test/scripts/apple-app-i18n.test.ts,node scripts/check-changed.mjsgreen.macos-swiftCI job (never run on an operator desktop).origin/main, P2): five findings, four fixed in the follow-up commit (native consent for high-risk capability enablement, login item still disable-able after the app moves, microphone tester released on terminal callbacks, no case-only string-catalog renames so existing translations survive); the fifth ("new strings are English-only in other locales") is the normal post-merge native locale-refresh flow and is not a defect.PermissionMonitorpoll for the lifetime of dashboard windows; it refreshes on activation, after its own permission requests, and on the webstatusmessage.fix(macos): confirm sensitive device settings natively(native consent sheet, login-item disable path, microphone tester release, catalog key restores, no TCC polling),fix(macos): publish valid voice locale selections(live-test finding above), andchore(macos): leave the string catalog to the locale refresh workflow(the preflight scope gate requires native source changes plusapps/.i18n/native-source.jsononly;Localizable.xcstringsstays owned by the post-merge native locale refresh, so new strings show English until that runs).fix(macos): confirm voice wake and location escalation natively(final review pass: Voice Wake on, precise location on, and any location-mode escalation now also require the native consent sheet) andchore(macos): remove dead symbols left by the settings retirement(Periphery strict scan clean; removes the now-subscriber-less 1 s TCC poller, the native onboarding chat views the custodian replaced, and pane-only presentation helpers; the stalenative-app-i18ninventory test now asserts surviving copy). Cumulative production delta on this branch is about −12.2k lines.Final build (head with the consent and locale fixes), same isolated rig:
fix(macos): confirm presence reporting and point older Gateways at Dashboard settings: enabling active-computer-presence reporting now needs the same Cancel-default native consent (it shares this Mac's idle time with the Gateway), and the native Connection window gained a footer that tells users where app-local settings live and that the Gateway must include those Dashboard pages, with an "Open Dashboard Settings" button; the Connection and Updates docs say the same. No version gates or compatibility fallbacks were added, per the ownership doctrine. Branch rebased onto currentmain.mainkeeps touching retired test files. As of8ef56e23c9dthe only conflicts areapps/macos/Tests/OpenClawIPCTests/CronJobsStoreTests.swift(content) andapps/macos/Tests/OpenClawIPCTests/SkillsSettingsSmokeTests.swift(deleted here, modified upstream); keep this branch's deletion and itsCronJobsStoreTestsfixture shape, thenpnpm native:i18n:baseline.fix(macos): retire consent with Dashboard documents(the native suite caught that consent sheets and queued requests survived document replacement or window teardown; now cancelled, with lifecycle tests),fix(macos): route bridge settings deep links through their permission owners(one owner for System Settings deep links; the existing "unrelated permissions get no privacy pane" test stays valid),fix(macos): preserve Dock icon selection in Dashboard(the retired General pane's icon style picker is nowapp.iconStyleon the bridge),fix(macos): settle dashboard edits after native consent(the bridge answerssetwith the settled snapshot viaWKScriptMessageHandlerWithReply, so the web clears drafts only after native settlement),fix(macos): fence pending Voice Wake authorizationandfix(macos): preserve newer location permission intent(generation guards so a newer Off cannot be overwritten by an older awaited authorization),fix(macos): publish language-aware Voice Wake availability,fix(macos): reject stale cookie domain consentand browser-session validation before device-settings writes, plus test-only isolation fixes for hosted-runner flakes hit along the way (native-app-i18ninventory assertions, iOS Watch settlement waits,package-mac-appreadiness,dashboards-list-demande2e). Exact-head native proof: the hostedrelease_gatedispatch run (macos-swift tests and release green).6786d743485): fixed infix(macos): reject stale cookie domain consentandfix(macos): validate the browser session before device settings writes. After the native sheet resolves, the handler recomputes the consent the current shared allowlist would require and rejects the write unless it equals the consent that was actually shown; cookie-domain and profile mutations are now synchronous with that check (no await between check and write), and every device-settings write additionally requires a current, validated browser-session lease. Proof is the AppKit/WebKit lifecycle suite (apps/macos/Tests/OpenClawIPCTests/DashboardDeviceSettingsLifecycleTests.swift, real windows and sheets):revoke-domainsis the reviewer's reproduction (window A requests["existing.test", "added.test"], window B removesexisting.testwhile A's sheet is open, A is allowed): A'ssetpromise resolves with the settled snapshot whosebrowser.cookieSync.domainsis[], the sharedcookieSyncDomainsstays[], soCookieSyncManagernever observes a restored domain and no cookie-sync process is launched for it;normalize-profile/provisionalprove normal approval still persists["existing.test", "added.test"];revoke-session(new) revokes the session lease during consent and both promises reject with no write. Local run at the pushed head:swift test --build-system native --filter 'DashboardDeviceSettingsLifecycleTests|DashboardBrowserSessionTests'→ 12 tests in 2 suites passed (all 9 lifecycle transitions).openclaw.jsonkeys added, changed, or removed; no SQLite or other stored data-model change (the "unknown-truncated-pull-files" marker is the reviewer's truncated file list); one legacy UI preference retired (the native-pane visibility escape hatch), all capability preferences keep their existing app-defaults keys and native owners; an app-only upgrade against an older Gateway keeps native Connection recovery and the Connection window's footer pointing at Dashboard settings, which is the accepted upgrade contract from the ownership decision, without version gates.mainat3e4becea5e2; the worker's unrelatedtest(gateway): isolate update run ledger fixturescommit was dropped because test(update): isolate campaign RPC ledger state #139116 landed the upstream fix for that file, and a stray readability tweak to an Android UI test was reverted so the PR stays on the Mac and Dashboard surfaces. Exact-head native proof for the pushed head: hostedrelease_gatedispatch run https://github.com/openclaw/openclaw/actions/runs/33982020911. The PR's own pull_request run failedmacos-swift (tests)on one unrelated case,OnboardingAISetupTests"activation consent uses shared wizard" (rejected-unavailable, manual), whose two-second poll caps left the AI setup model still busy on the hostedmacos-26runner; this PR does not touch that model, and the hosted exact-head run passed the same suite. Recorded as a follow-up for that test's settlement wait.