fix(desktop): declare Apple Events access for Computer Use cleanup#33869

merged4
main
GitHub fork: fix/computer-use-apple-events
opened21d agobyLloia5tqd001
View on GitHubTwo-way sync enabledPR last imported 9d ago

Problem

Codex Computer Use inside the packaged T3 Code macOS app cannot clean up its native overlay after a turn. The visible Software Cursor remains because macOS rejects the cleanup helper's Apple Events request. The signed T3 0.1.8 app lacks com.apple.security.automation.apple-events and NSAppleEventsUsageDescription, so the user cannot grant Automation permission.

This is tracked by https://git.cafe/pingdotgg/t3code/issues/21282. PR https://git.cafe/pingdotgg/t3code/pulls/2796 proposed the same declarations, but it was closed as fixed by https://git.cafe/pingdotgg/t3code/pulls/2745. https://git.cafe/pingdotgg/t3code/pulls/2745 changed Tailscale and filesystem TCC prompt behavior and did not add these declarations.

Change

Add the macOS Apple Events entitlement and permission description to the desktop packaging configuration. Add focused assertions for both declarations.

The change is limited to the macOS capability needed by the existing Computer Use helper. It does not change thread lifecycle, notification wiring, runtime behavior, or the gateway.

Scope and approval

This is a very small, focused fix for an established capability and an obvious packaging defect. It qualifies for the focused-bug exception in CONTRIBUTING.md. The linked issue contains reproductions on multiple T3 versions, including current stable 0.1.8.

Verification

  • 11 focused packaging checks passed against current main.
  • git diff --check passed.
  • The checks confirm the patch adds only the Apple Events declarations and leaves the tested Linux, Windows, and other macOS build configuration unchanged.
  • Native TCC logs on official T3 0.1.8 show Policy disallows prompt for com.t3tools.t3code for kTCCServiceAppleEvents.
  • A fresh unentitled diagnostic identity receives the same denial and helper transport error.
  • An authorized diagnostic test launched the official helper through the bundled signed Codex app-server with the same turn-ended payload. It removed the visible Software Cursor.
  • The helper exits 0 on transport failure, so cleanup was verified from TCC logs, helper errors, service contact, and CGWindowListCopyWindowInfo.

I could not build and test the patched T3 app because this machine has no valid Apple signing identity. A signed T3 build and macOS Automation approval are still required for the final end-to-end test.

Model: Sol 6.1. Harness: Codex in T3 Code.

Fixes pingdotgg/t3code#21282

Checks

22 successful · 20 skipped
All checks passed
5c3f0ac

Added 1 commit

  • fix(desktop): declare Apple Events access for Computer Use cleanupe114f51
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — The packaging change enables macOS Automation permission requests for terminal and agent commands, not only Computer Use cleanup. Human review is needed to accept that broader default capability; macOS authorization still gates access.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between d3e47ee393743df640824d5d245ca7883e38f82c and 5c3f0ac7068ecd662cd9e3e6064a08b33ae47011.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The macOS desktop build configuration now includes an Apple Events usage description and enables the Apple Events automation entitlement. Tests check that both declarations are present.

Changes: Apple Events macOS packaging permissions

Layer / File(s)Summary
Declare and test Apple Events access
scripts/build-desktop-artifact.ts, scripts/build-desktop-artifact.test.ts
The macOS build configuration adds an Apple Events usage description and enables the Apple Events automation entitlement. Tests check that the description is non-empty and the entitlement is enabled.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: jacksondr5, juliusmarminge

Merge Risk: Minimal · previous review d3e47

This change declares Apple Events access in the macOS desktop packaging so users can grant the Automation permission that Computer Use cleanup needs. The reviewed code shows no remaining merge-blocking risk. Final end-to-end confirmation with a Developer ID-signed build is still outstanding.

Pre-merge checks: 4

Check nameStatusExplanation
Title checkThe title names the main change: declaring Apple Events access for the macOS desktop app, which the changeset does (entitlement plist plus NSAppleEventsUsageDescription). It also gives the purpose, Co…
Description checkThe description follows the template's sections: Problem, Change, Scope, and Verification. It explains the bug, the Apple Events entitlement and usage-description change, the justification for the foc…
Linked Issues checkDirectly linked issue #21282 asks that the signed T3 macOS app declare com.apple.security.automation.apple-events and NSAppleEventsUsageDescription. The whole-PR diff (merge base to current head d…
Out of Scope Changes checkThe whole-PR diff against the merge base has three code hunks. Each one maps to the linked issue. Hunk 1 adds the Apple Events entitlement to the macOS entitlements template. Hunk 2 adds `NSAppleEvent…
Full details: Title check

Explanation

The title names the main change: declaring Apple Events access for the macOS desktop app, which the changeset does (entitlement plist plus NSAppleEventsUsageDescription). It also gives the purpose, Computer Use cleanup. The title is specific and matches the diff summary and objectives.

Full details: Description check

Explanation

The description follows the template's sections: Problem, Change, Scope, and Verification. It explains the bug, the Apple Events entitlement and usage-description change, the justification for the focused-bug exception, and detailed verification with stated limits (no signing identity, no end-to-end test). It also names the model and harness, as the template asks. The template's Scope section asks for a linked issue, and the author links issue #21282. The description does not follow the template's HTML-comment prompts literally, but it covers each required element.

Full details: Linked Issues check

Explanation

Directly linked issue #21282 asks that the signed T3 macOS app declare com.apple.security.automation.apple-events and NSAppleEventsUsageDescription. The whole-PR diff (merge base to current head d3e47ee) confirms both. In scripts/build-desktop-artifact.ts, the entitlements template adds <key>com.apple.security.automation.apple-events</key><true/>. The macOS build config adds a non-empty NSAppleEventsUsageDescription. In scripts/build-desktop-artifact.test.ts, assertions cover the usage description for stable and nightly, signed and unsigned builds, and a regex assertion checks that the rendered entitlement is true. These are the coding requirements of the issue. The issue's runtime goal (cleanup completes and the cursor disappears) depends on a signed build and macOS Automation approval. The PR states these have not been run. That runtime outcome is not verified by code evidence, but the declared requirements are met.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base has three code hunks. Each one maps to the linked issue. Hunk 1 adds the Apple Events entitlement to the macOS entitlements template. Hunk 2 adds NSAppleEventsUsageDescription to the macOS build config. Hunk 3 adds test assertions for both declarations. The test title change only extends the existing Calendar test description to cover the new key. No thread lifecycle, notification wiring, gateway, or runtime code changes appear in the diff. The changes since the previous review do not add any new code hunks outside these three.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2abe9c641eb08088e1263856db5c8740af47d3bf and d3e47ee393743df640824d5d245ca7883e38f82c.

Files selected for processing: 2

  • scripts/build-desktop-artifact.test.ts
  • scripts/build-desktop-artifact.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Synced from GitHub

A/B evidence this fixes Codex Computer Use bootstrap (in addition to the overlay cleanup)

Tested locally on macOS (Apple Silicon), packaged T3 Code (Beta) app bundle 0.1.6, server runtime 0.1.9:

Official signed app (no entitlement)Same app copy + this PR's changes
com.apple.security.automation.apple-eventsabsentpresent
NSAppleEventsUsageDescriptionabsentpresent (same string as this PR)
Codex computer-use list_appsbootstrapTimedOutsucceeded — 14 running apps returned

Method: copied the installed .app, added only the two declarations from this PR to the bundle/entitlements, ad-hoc re-signed (all other code identical; nested helpers kept their original signatures), and ran it under a separate bundle ID + T3CODE_HOME so the production install was untouched. In the patched copy the Codex app-server log shows cua_repl MCP tool calls completing, with no bootstrapTimedOut anywhere in the server logs. The unpatched app fails the same call on the same machine/account.

Caveats:

  • Ad-hoc signature, not Developer ID — proves the entitlement is the missing piece, not the release pipeline.
  • Only list_apps/bootstrap verified so far (the exact step that previously died). Full click/type flows not yet exercised.
  • Codex still reports "The browser access host is unavailable" afterwards — that appears to be the separate Chrome-plugin path, not Computer Use core.

Happy to share exact repro steps. This PR currently shows as conflicting with main — a rebase would hopefully make it reviewable, since the change itself is +4 lines. Tracks #21282.

Added 1 commit

  • Merge remote-tracking branch 'origin/main' into fix/computer-use-apple-events2abe9c6

The automated pipeline stopped on this pull request and will not merge it:

the fix is written and reviewed, but proving it needs something no worker has:

  • Permanent blocker: A macOS desktop host with signed base and head builds and configured Codex Computer Use is required. The available Linux environment cannot show the base TCC denial, Automation consent after the patch, helper transport results, or actual Software Cursor removal. The brief prohibits accessing another machine; the iOS device pool cannot reproduce macOS desktop behavior.

It stays open for a person to finish or close.

Synced from GitHub

This PR conflicts with main. Rebase it or merge main into it. If it still conflicts after 7 days with no activity, it will be closed automatically.

See the conflict window.

Synced from GitHub

This is needed for stuff like REA with Hopper integration as well.

Synced from GitHub

Verified the cursor cleanup on Apple Silicon, macOS 26.5.1 (25F80), using signed builds of base 5cff012416c25e6b88d7f61036171e47729c3f18 and PR head 2abe9c641eb08088e1263856db5c8740af47d3bf. The base reproduced #21282. On the head, the cursor disappeared on its own after both turns while T3 kept running.

RunAutomation and cleanup resultVisible software cursor after turn completion
BasemacOS denied Apple Events for the test host because its entitlement was missing. The cleanup client logged a transport error.Still present at 20.3 s. Cleared when the test host was stopped.
Head, first turnmacOS logged the Automation prompt for T3 to access Codex Computer Use, then recorded the permission entry.First absent at 4.6 s. Still absent at 18 s.
Head, second turnReused the existing grant.First absent at 0.6 s. Still absent at 8 s.

Each fresh T3-hosted Codex thread clicked the same AppKit fixture button and finished normally. The fixture independently recorded each click. A separate observer sampled the macOS window list about four times per second for the helper’s visible 126 × 126 cursor window. Times above are relative to the CLI reporting turn completion.

Both arm64 app bundles used the same local Apple Development identity, hardened runtime and test bundle ID. I verified the signatures and the presence or absence of both Apple Events declarations. The test exercised the packaged Electron executable and server CLI through Launch Services. The full desktop window, T3’s distribution signature and its upgrade path remain untested.

ChatGPT 26.1117.31558 · Computer Use helper 26.1116.1001980 · bundled Codex CLI 0.171.0-alpha.13.

Added 2 commits

  • Merge remote-tracking branch 'origin/main' into fix/computer-use-apple-eventsd3e47ee
  • Merge branch 'main' into fix/computer-use-apple-events5c3f0ac