Repository navigation
fix(macos): use personal identity for team dashboards - #137933
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 4, 2026, 11:40 AM ET / 15:40 UTC. ClawSweeper reviewWhat this changesThe PR makes remote macOS dashboards use a verified personal browser identity instead of shared Gateway credentials when a safe public identity ingress is available. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 4 items remain The PR remains necessary and its identity-routing and lifecycle boundaries are internally coherent; no introduced correctness or security defect was found. A release owner should explicitly accept deployment-stage signed-Mac Team sign-in verification before merge. Priority: P1 Review scores
Verification
How this fits togetherThe Gateway advertises a credential-free identity URL to authenticated operator clients. The macOS dashboard opens that URL for browser sign-in while native device operations remain on the existing Gateway connection. flowchart LR
A[Remote macOS dashboard] --> B[Authenticated Gateway connection]
B --> C[Identity ingress resolution]
C --> D[Credential-free HTTPS URL]
D --> E[Browser personal sign-in]
E --> F[Personal dashboard identity]
Decision needed
Why: The source and regression coverage support the patch, but the actual Team identity ingress requires deployment-specific signed-app evidence unavailable in this read-only checkout. Before merge
Agent review detailsSecurityNone. PR surfaceSource +87, Tests +334, Docs +23, Other +1286. Total +1730 across 32 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Obtain explicit release-owner acceptance of the canonical post-deployment signed-Mac Team sign-in check and rollback ownership before merge. Do we have a high-confidence way to reproduce the issue? Yes—source shows the prior remote dashboard path used shared credentials, and the issue supplies an observed signed-macOS reproduction; this read-only review did not execute it locally. Is this the best way to solve the issue? Yes—the PR preserves native device access while using a validated credential-free public ingress for personal browser identity. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 407a8f453c0f. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What 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 (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The identity URL now comes from the active identity ingress. Managed Tailscale Serve uses its lifecycle-owned published hostname; a generic public origin is no longer accepted as proof of Tailscale identity. The same route record serves MCP links, and hello samples it immediately before delivery. Five mismatch/withdrawal regressions failed before the repair; all 52 focused Gateway/lifecycle/MCP tests now pass. Hosted native testing also exposed asynchronous dashboard recovery ordering and outdated synchronous fixtures. Recovery now retires only its captured older navigation intent when the document changes, while later notifications queue for the successor in the same window. Independent reviews found no actionable P0–P2 findings in either correction. The PR body records exact proof, scope, and the same-task signed-app validation after canonical main deployment. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
d3f4113 to
5e8273a
Compare
|
@clawsweeper re-review Final head is The branch was refreshed onto current main to include the existing Browser cleanup repair; all eight task commits remained patch-identical through rebase. The exact original unmocked 14-case Gateway regression now passes with unchanged deadlines. Final exact-head CI is running at https://github.com/openclaw/openclaw/actions/runs/33857055937. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Open remote identity-authenticated dashboards at the verified public browser ingress without native shared credentials or TLS pins. Keep native bridges scoped to the dashboard and queue shortcuts until its shell listeners are ready. Fixes #137916.
|
Merged via squash.
|
|
Post-merge deployment validation: the canonical deployment owner accepted a main revision containing this fix, with exit 0, no activation journal, and unchanged approval policy. Independent serving/build, RPC, channel, and health checks passed. The live authenticated A Developer ID-signed Release app built from the merged commit has been installed and restarted. The real app now reaches the personal GitHub sign-in flow. Final personal-footer and authenticated native-command verification are waiting on the user's one-time sign-in in the embedded browser; they are not yet claimed as passed. |
* fix(macos): use personal identity for team dashboards Open remote identity-authenticated dashboards at the verified public browser ingress without native shared credentials or TLS pins. Keep native bridges scoped to the dashboard and queue shortcuts until its shell listeners are ready. Fixes openclaw#137916. * fix(macos): align identity bridge lint and native strings * refactor(ui): remove native readiness type assertions * fix(gateway): advertise the active browser identity ingress Use the live managed Serve origin for personal browser authentication and withdraw it with its route claim. Keep trusted-proxy public origins separate, reuse the existing published-route lifecycle for MCP links, and sample identity metadata immediately before hello delivery. * fix(macos): preserve navigation during identity recovery * test(macos): reproduce closed identity presentation race * fix(macos): retire identity presentation when its window closes * fix(gateway): retire stale browser identity connections * test(macos): reproduce saved profile identity reconnects * fix(macos): follow saved profile identity reconnects * test(macos): reproduce stale identity discovery completion * fix(macos): scope identity completion to live windows * test(macos): isolate dashboard identity connection modes * test(macos): await driver stderr cleanup without blocking
* fix(macos): preload dashboard after remote gateway authentication - Launch preload arms a one-shot remote preload when the synchronous local-only config is unavailable in remote mode. - The armed preload starts when the control channel reports connected and resolves the primary dashboard through the hello-gated windowConfiguration(for: .primary), so remote identity dashboards never receive pre-hello native credentials (keeps the #137933 local-only guard). - The preload is discarded once the user opens a dashboard, a presentation is in flight, an explicit main window open is in flight, the main target is not primary, or the mode leaves remote. - New-window presentation honors present: false so the preload stays hidden and records the presented endpoint for reuse on the first open. - DashboardRemotePreloadDecision is pure logic with unit tests. - DashboardRemotePreloadTests cover reuse of the hidden document on the first open and both open-versus-preload orderings, through a DEBUG-only control channel override and arming hook. * fix(macos): retain the hidden remote dashboard preload - A newly created main controller presented with present: false is marked experience-hidden before its document loads, so hasRetainedWindow is true, native sign-in challenges are answered and endpoint changes reconcile it before the first open. - show() and windowWillClose still end that hidden lifetime. - preloadIfConfigured() returns its task and arms the remote preload on connectionMode == .remote; its only caller is the shared manager. - The DEBUG-only _testArmRemotePreload() is removed; tests drive preloadIfConfigured() in remote mode after onboarding. - New test: the hidden remote preload follows an endpoint change before the first open. - The remote preload test helper creates NSApplication.shared, so each test runs alone without relying on test order. * fix(macos): keep the hidden dashboard preload out of window counts - DashboardWindow.isUnshownPreload is set by retainHidden() and cleared by show(). - openWindowCount(for:) skips an unshown preload, so the Gateways menu card does not read "1 window" while nothing is on screen. - The flag lives on the window, so it survives an endpoint change that replaces the controller. - Remote preload tests assert count 0 while hidden, 1 after show() and 0 after an endpoint change. * test(macos): prove native challenges on the hidden remote preload - New DashboardRemotePreloadTests case drives a real WK native challenge into the hidden preloaded document: answered while current, refused after socket retirement, document recommit or a mid-flight browser identity switch, and never reaches the provider for a browser identity document. The preload stays hidden throughout. - Remove DashboardRemotePreloadDecisionTests: it mirrored the decision enum's guards; the manager suite covers the observable behavior.
) * fix(macos): preload dashboard after remote gateway authentication - Launch preload arms a one-shot remote preload when the synchronous local-only config is unavailable in remote mode. - The armed preload starts when the control channel reports connected and resolves the primary dashboard through the hello-gated windowConfiguration(for: .primary), so remote identity dashboards never receive pre-hello native credentials (keeps the openclaw#137933 local-only guard). - The preload is discarded once the user opens a dashboard, a presentation is in flight, an explicit main window open is in flight, the main target is not primary, or the mode leaves remote. - New-window presentation honors present: false so the preload stays hidden and records the presented endpoint for reuse on the first open. - DashboardRemotePreloadDecision is pure logic with unit tests. - DashboardRemotePreloadTests cover reuse of the hidden document on the first open and both open-versus-preload orderings, through a DEBUG-only control channel override and arming hook. * fix(macos): retain the hidden remote dashboard preload - A newly created main controller presented with present: false is marked experience-hidden before its document loads, so hasRetainedWindow is true, native sign-in challenges are answered and endpoint changes reconcile it before the first open. - show() and windowWillClose still end that hidden lifetime. - preloadIfConfigured() returns its task and arms the remote preload on connectionMode == .remote; its only caller is the shared manager. - The DEBUG-only _testArmRemotePreload() is removed; tests drive preloadIfConfigured() in remote mode after onboarding. - New test: the hidden remote preload follows an endpoint change before the first open. - The remote preload test helper creates NSApplication.shared, so each test runs alone without relying on test order. * fix(macos): keep the hidden dashboard preload out of window counts - DashboardWindow.isUnshownPreload is set by retainHidden() and cleared by show(). - openWindowCount(for:) skips an unshown preload, so the Gateways menu card does not read "1 window" while nothing is on screen. - The flag lives on the window, so it survives an endpoint change that replaces the controller. - Remote preload tests assert count 0 while hidden, 1 after show() and 0 after an endpoint change. * test(macos): prove native challenges on the hidden remote preload - New DashboardRemotePreloadTests case drives a real WK native challenge into the hidden preloaded document: answered while current, refused after socket retirement, document recommit or a mid-flight browser identity switch, and never reaches the provider for a browser identity document. The preload stays hidden throughout. - Remove DashboardRemotePreloadDecisionTests: it mirrored the decision enum's guards; the manager suite covers the observable behavior.
Closes #137916
What Problem This Solves
Opening a Team dashboard through the macOS app could show Owner instead of the signed-in person. The embedded dashboard reused the native SSH/shared-credential connection, which authenticates the machine as the Gateway owner. The authenticated Gateway hello now advertises an eligible HTTPS personal sign-in URL. The Mac opens that URL without native tokens, passwords, or TLS pins, clears a previously cached shared token, and lets normal Team sign-in establish the person's profile.
Native RPC and Quick Chat retain their separate machine identity. Shared-secret gateways retain their supported dashboard flow. No configuration option, database/schema change, or protocol-version bump is introduced.
Implementation
Identity discovery belongs to the serving ingress: configured HTTPS for trusted-proxy authentication, or the lifecycle-owned hostname of an active managed Tailscale Serve route. Generic public origins, stopped routes, and Funnel do not establish personal authentication. The existing published-route record also supplies MCP links. Withdrawing or replacing a Serve claim retires the connections that received that exact lifetime, using the existing reconnect close code; old cleanup cannot revoke its replacement.
Native scripts, metadata, callbacks, and commands are constrained to the current dashboard origin, mount, route lease, and document generation. HTTPS sign-in redirects remain in the window, and native commands wait for the actual dashboard listener. Recovery preserves later navigation, notifications, and pending picker commands. Closing a window retires its pending lookup even if the same native shell reopens; other primary windows remain independent. Network and explicit failures share one action-retirement policy.
Saved-profile windows observe their own native connection. A fresh hello reconciles that profile's windows, while profile revisions fence retired announcements and delayed work. Existing reconciliation preserves unchanged documents and later selections. Discovery and observation share one awaited connection provider. Cosmetic relabeling would hide the attribution problem; an admin-only configuration probe would exclude read-only operators and could advertise an inactive route.
Validation
Required CI 33882899608 passed on signed head
ab76a915d5dc23a963e82fa8fc3d4fad8465419a, attempt 2. The required aggregate check passed at 15:29 UTC. All 132 executed prerequisite jobs passed, including Mac Release, 1,629 shared Swift tests, 2,101 Mac app tests, IPC/CLI, core/browser checks, iOS Release, lifecycle/UI, Watch, and screenshots. Six jobs were skipped according to the existing PR scope.The first attempt completed its core/browser/screenshots work, but the two Blacksmith Mac jobs never received runners. Its iOS logic suites passed 321 lifecycle and six voice tests; Xcode then timed out launching the app for the UI case before its assertions. After all active jobs finished, the supported partial retry preserved successful jobs, moved Mac phases to hosted runners, and reran the failed iOS job. Mac tests and the complete iOS retry passed without further source or deadline changes.
The previous branch validation 33870230433 passed all Mac, shared, IPC/CLI, Linux, Windows, Android, browser, and mobile checks at
87637. The PR-attached run 33870230930 instead tested merge0a8f8d7finto main72a1d6f: it exposed the already-repaired Code Mode fixture, one PowerShell process startup timeout before completion code ran, and a blocking wait in the Mac stderr fixture. All other lanes passed, including iOS and screenshots.The stderr fixture now suspends through its existing async wait helper instead of blocking the executor needed by cleanup. Its original two-second limits, zero-time check, and drain/cancellation assertions remain. The failing CI captured the original timeout; formatting, strict lint, and independent P0–P2 review pass for the correction (test-only +9/-9, production zero). The final hosted run passes both stderr cases and the complete native suites.
Focused hello/startup, shell/settings, and native-shell suites passed (37, 57, and 38 tests). Ingress/lifecycle/MCP coverage passed 52 cases; three real-WebSocket withdrawal regressions failed before the lifetime repair, then all 65 owner/sibling cases passed, followed by the strengthened 31-case hello suite. Tailscale itself is a fixture here, not a live Tailnet proof.
Hosted differential tests cover window close, saved-profile hello withdrawal/replacement, delayed discovery completion, pending picker commands, and close/reopen of the same native shell. The frozen saved-profile reproduction failed six assertions only in its new reconnect test (before); the final delayed-completion reproduction failed all seven intended assertions (before). The repaired cases pass in final CI. Two task-owned tests now hold the existing global-state isolation lock; assertions and deadlines are unchanged, with no production delta.
Pinned strict Swift lint/format, native strings, core production/test types, core lint, and ownership guards passed. Independent Codex review has no remaining accepted P0–P2 findings. Synthetic Chromium proof verifies a named footer, no outgoing shared credentials, actual native search, listener teardown, and zero page errors.
Deployment-stage live validation: the canonical Team deployer accepts merged main, so its new hello cannot be exercised before merge without an unsupported overlay. For this authorized fix-and-land, the acting maintainer accepts personal sign-in verification after canonical deployment and signed Mac restart in this task, before declaring completion. Synthetic proof is not represented as live SSO. The latest ClawSweeper review at 15:40 UTC covers exact head ab76 and found no correctness/security defect. Deployment validation and recovery owner: @steipete, through this authorized maintainer task. The acting maintainer accepts canonical deployment followed by Developer ID-signed Mac installation, personal-footer and native-command verification, and a redacted result before task completion. If personal browser identity fails, restore the backed-up signed Mac app and use only the canonical deployment owner's supported recovery; continue the repair before reporting completion. The +419 production lines are accepted because the reviewed ingress, credential, profile, and window-lifetime boundaries cannot be removed without losing the required isolation. The remaining optional rank-up move is the planned signed-Mac result after deployment.
Synthetic before/after (no real accounts, chats, or Gateway details):
Scope and follow-ups
Production: +709/-290 (net +419); tests/support: +1400/-117 (net +1283); generated Swift +4; native string inventory +2/-1; docs +23. Growth establishes personal browser authentication, native document isolation, route lifetime invalidation, and independent profile observation. Existing discovery, subscription, and reconciliation owners are reused; no configuration RPC, retry loop, or separate discovery cache is introduced. Protocol and macOS docs describe the new behavior.
Unchanged CI fixtures exposed separate follow-ups: Cron mock socket event delivery, Android foreground-service observation of late HTTP arrival, Windows stalled-download diagnostics, and competing tooltip/drawer Escape handling. Those lanes passed subsequent runs; unchanged heartbeat tests also passed all 26 cases in their original order after a CI timeout. No speculative production patch or larger deadline was added. An unchanged iOS Watch receipt-recovery test initially missed its two-second polling deadline while the old canceled transfer was still draining. One focused rerun passed both cases in 0.123 seconds and completed every remaining mobile check. Buffered arrival signaling in that polling fixture remains a named follow-up; no dropped production resume was demonstrated.
The native merge guard requires the PR-attached check; a green manual branch validation does not replace it. The refreshed required run passed on the updated integration. No gate override is used. Native source verification passes after regenerating the merged inventory; full generated-locale parity still reports pending translations, including the new recovery text, and remains with the existing translation-generation workflow.