Skip to content

fix(macos): keep Gateway profile Keychain reads noninteractive - #130542

Closed
Patrick-Erichsen wants to merge 2 commits into
pe/macos-onboarding-codex-probefrom
pe/macos-onboarding-keychain
Closed

Patrick-Erichsen wants to merge 2 commits into
pe/macos-onboarding-codex-probefrom
pe/macos-onboarding-keychain

Conversation

@Patrick-Erichsen

@Patrick-Erichsen Patrick-Erichsen commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Keep automatic Gateway-profile reads and legacy migration from opening login-Keychain authentication UI. Preserve hidden profiles and pending migration state when an explicit mutation later receives Keychain access.

This is layer 2 of the macOS onboarding/prewarm stack and replaces #128820. The commits preserve Hannes Rudolph's authorship.

Stack

  1. fix(macos): allow cold ChatGPT Codex probes #130541 — Codex cold-start probe
  2. fix(macos): keep Gateway profile Keychain reads noninteractive #130542 — noninteractive Gateway-profile Keychain access (this PR)
  3. feat(macos): bundle an exact prewarmed core runtime #130543 — exact prewarmed core runtime
  4. feat(macos): cache exact plugins for prewarmed builds #130544 — exact prewarmed official-plugin cache

Evidence

Draft status

A final owner-boundary repair is intentionally pending: the legacy interaction switch is process-wide, so the profile store and activation-binding store must use one shared coordinator with an overlap regression before this layer is ready.

@clawsweeper

clawsweeper Bot commented Aug 27, 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 app: macos App: macos size: M maintainer Maintainer-authored PR labels Aug 27, 2026
@Patrick-Erichsen Patrick-Erichsen changed the title pe/macos onboarding keychain fix(macos): keep Gateway profile Keychain reads noninteractive Aug 27, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. 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. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 7, 2026, 5:37 AM ET / 09:37 UTC (Revision 3).

ClawSweeper review

What this changes

The macOS app suppresses automatic Gateway-profile Keychain prompts and preserves hidden profiles and pending legacy migration data during later explicit edits.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open: current main provides partial coverage, but this useful repair remains incomplete and the earlier P1 finding is still present.

Priority: P2
Reviewed head: ba998ac19f84c83145a8e1f7ef60f97b9214748b

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful native proof and migration coverage support the repair, but the acknowledged shared-state defect prevents merge readiness.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The linked Base-VM native transcript exercises identical profile-store source against a restrictive legacy ACL and records restored interaction state plus an after-fix launch without SecurityAgent. Attachment inspection was unavailable, so no screenshot inspection is claimed. Concurrent binding access remains an independent finding. Registry encoding is unchanged, and boundary regressions cover existing-profile and migration preservation.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (logs): The linked Base-VM native transcript exercises identical profile-store source against a restrictive legacy ACL and records restored interaction state plus an after-fix launch without SecurityAgent. Attachment inspection was unavailable, so no screenshot inspection is claimed. Concurrent binding access remains an independent finding. Registry encoding is unchanged, and boundary regressions cover existing-profile and migration preservation.
Evidence reviewed 9 items Pinned introduced change: Reviewed the introduced production diff and complete changed modules at the original head. The new interaction switch is protected by a profile-private lock; interactive operations bypass that lock.
Uncoordinated sibling and consequence: The activation-binding store calls SecItemCopyMatching and SecItemAdd without the profile lock. GatewayConnection obtains and retains its optional binding key during configuration; an overlapping denied lookup leaves its ownership fingerprint unavailable. Onboarding rejects unbound completed receipts rather than authorizing a handoff.
Direct Apple contract inspection: The dependency signal is the introduced direct SecKeychainSetUserInteractionAllowed call. Apple's implementation sets the shared Globals interaction flag; Globals.h:53-54 accesses that flag, and Globals.cpp:56-73 selects prompted or noninteractive credentials from it. A profile-only lock therefore cannot isolate sibling Keychain operations.
Findings 1 actionable finding [P1] Share the process-wide Keychain interaction guard
Security None None.

How this fits together

The macOS Gateway-profile store turns saved endpoints and credentials into connection settings for Gateway windows. Background refresh and explicit profile edits share the login Keychain with activation-binding operations.

flowchart TD
 A[Background profile refresh] --> C[Gateway profile store]
 B[Explicit profile edits] --> C
 C --> D[Keychain interaction policy]
 D --> E[Login Keychain]
 F[Activation binding store] --> E
 E --> G[Gateway connection settings]
Loading

Before merge

  • Share the process-wide Keychain interaction guard (P1) - The earlier P1 remains at the same reviewed head. While a background profile operation has disabled process-wide interaction, GatewayActivationBindingKeyStore.loadOrCreate() can execute SecItemCopyMatching or SecItemAdd outside this private lock. An ACL-protected lookup then fails without requesting authorization, and GatewayConnection.configure retains a nil binding key, preventing a completed bound onboarding receipt from being verified. Put both stores' operations behind one coordinator and add a controlled overlap regression.
  • Resolve merge risk (P1) - Background profile reads can temporarily prevent authorized activation-binding Keychain access, leaving onboarding without its credential binding.
  • Complete next step (P2) - Repair the shared Keychain coordinator and overlap regression, then complete the requested signed restack onto main while preserving current profile behavior and refreshing native validation.

Findings

  • [P1] Share the process-wide Keychain interaction guard — apps/macos/Sources/OpenClaw/MacGatewayProfiles.swift:163-167
Agent review details

Security

None.

PR surface

Other +274. Total +274 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 2 315 41 +274
Total 2 315 41 +274

Review metrics

Metric Value Why it matters
Production versus test LOC Production +165/-41, net +124; tests +150/-0 Growth introduces explicit unavailable-state handling and credential-preserving mutation recovery; the shared coordinator should absorb the existing private interaction guard.

Merge-risk options

Maintainer options:

  1. Coordinate the Keychain boundary (recommended)
    Route profile and activation-binding operations through the same coordinator and prove an authorized binding lookup survives overlap with a noninteractive profile read.

Technical review

Best possible solution:

Use one shared interaction coordinator for affected in-process Keychain consumers, preserving current-main denial recovery and credential-safe mutations while replacing the profile-private guard.

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

Yes, source and Apple's shared-state implementation establish the overlap trigger: pause a profile read after disabling interaction, then perform an ACL-protected binding-key lookup. This review did not execute that scenario.

Is this the best way to solve the issue?

No, the repair is too narrow at the interaction boundary: query-level controls cannot suppress the demonstrated legacy ACL prompt, while a profile-private lock cannot protect sibling Keychain operations.

Full review comments:

  • [P1] Share the process-wide Keychain interaction guard — apps/macos/Sources/OpenClaw/MacGatewayProfiles.swift:163-167
    The earlier P1 remains at the same reviewed head. While a background profile operation has disabled process-wide interaction, GatewayActivationBindingKeyStore.loadOrCreate() can execute SecItemCopyMatching or SecItemAdd outside this private lock. An ACL-protected lookup then fails without requesting authorization, and GatewayConnection.configure retains a nil binding key, preventing a completed bound onboarding receipt from being verified. Put both stores' operations behind one coordinator and add a controlled overlap regression.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 5077ad4f99aa.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The linked Base-VM native transcript exercises identical profile-store source against a restrictive legacy ACL and records restored interaction state plus an after-fix launch without SecurityAgent. Attachment inspection was unavailable, so no screenshot inspection is claimed. Concurrent binding access remains an independent finding. Registry encoding is unchanged, and boundary regressions cover existing-profile and migration preservation.

Label justifications:

  • P2: This is a bounded native Keychain repair with useful evidence, without a demonstrated current emergency.
  • merge-risk: 🚨 compatibility: A background read can change the interaction policy observed by an existing authorized Keychain workflow.
  • merge-risk: 🚨 auth-provider: An overlapping activation-binding key lookup can fail and leave the connection without its credential ownership fingerprint.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🐚 platinum hermit and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (logs): The linked Base-VM native transcript exercises identical profile-store source against a restrictive legacy ACL and records restored interaction state plus an after-fix launch without SecurityAgent. Attachment inspection was unavailable, so no screenshot inspection is claimed. Concurrent binding access remains an independent finding. Registry encoding is unchanged, and boundary regressions cover existing-profile and migration preservation.
  • proof: sufficient: Contributor real behavior proof is sufficient. The linked Base-VM native transcript exercises identical profile-store source against a restrictive legacy ACL and records restored interaction state plus an after-fix launch without SecurityAgent. Attachment inspection was unavailable, so no screenshot inspection is claimed. Concurrent binding access remains an independent finding. Registry encoding is unchanged, and boundary regressions cover existing-profile and migration preservation.

Evidence

What I checked:

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Centralize the interaction switch across profile and activation-binding Keychain operations.
  • Add a controlled overlap regression proving an authorized binding lookup retains its key.

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 (2 earlier review cycles)
  • reviewed 2026-08-27T00:56:15.532Z sha ba998ac :: found issues before merge. :: [P1] Share the process-wide Keychain interaction guard
  • reviewed 2026-09-04T22:44:03.630Z sha ba998ac :: blocked before merge. :: [P1] Share the process-wide Keychain interaction guard

@vincentkoc

vincentkoc commented Aug 27, 2026 •

Copy link
Copy Markdown
Member

The canonical cold-probe fix has landed via #128819 as 1fd1d3ccb975e91c79265a093c5a638084ae217d. PR #130541 is patch-identical (95fde247551aff3e7eb005911009b6b58d44044c) and can be closed once this stack is detached.

The 13 descendant commits across #130542, #130543, and #130544 are valid Patrick-signed commits. A maintainer rebase would replace those signatures, so please restack them with your signing key:

  1. Rebase fix(macos): keep Gateway profile Keychain reads noninteractive #130542 with --gpg-sign onto current main, dropping parent 8b90f279770817ede1ecfe675233f1930a8469e5.
  2. Rebase feat(macos): bundle an exact prewarmed core runtime #130543 with --gpg-sign onto the new fix(macos): keep Gateway profile Keychain reads noninteractive #130542 head.
  3. Rebase feat(macos): cache exact plugins for prewarmed builds #130544 with --gpg-sign onto the new feat(macos): bundle an exact prewarmed core runtime #130543 head.
  4. Verify each range with git range-diff and every rewritten commit with git verify-commit.
  5. Change fix(macos): keep Gateway profile Keychain reads noninteractive #130542's base to main, then force-push all three branches atomically with exact leases.
  6. Reply with the three new heads.

Please keep the current P1 blockers and regenerate exact-head CI/package proof after the rewrite. #130541 will remain open until the descendant ancestry is verified.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Oct 7, 2026
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Closing as stale: this macOS onboarding/prewarm stack has been inactive since August, and main now bundles a matching private runtime. #128820 remains open for the Keychain fix itself.

Closed by Roboclaw at the author's request after an audit of his open PRs. The branch is kept, so this can be reopened if needed.

@RomneyDa
RomneyDa deleted the pe/macos-onboarding-keychain branch November 30, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: macos App: macos maintainer Maintainer-authored PR merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants