Repository navigation
fix(desktop): allow desktop-launched Computer Use to send Apple Events - #7000
Merged
Merged
Conversation
Contributor
|
Thanks for the pull request, @smsunarto. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Linked issue. Every pull request must close an open issue in this repository. The issue keeps the problem tracked even if this pull request closes or we take a different approach. Open an issue for the change, or find an existing one, and add See CONTRIBUTING.md for details. |
smsunarto
marked this pull request as ready for review
November 4, 2026 04:50
8 tasks
ymichael
added a commit
that referenced
this pull request
Nov 4, 2026
## Human comments ## What was wrong bb showed PR #7000 as "failing (22 passed, 4 failed)" while GitHub's commit rollup was `SUCCESS` and the PR was `CLEAN`. Every workflow had run twice on the head commit, both from `pull_request` events about a second apart. Concurrency cancelled CI run #20437, and its replacement, #20438, passed. GitHub's rollup only counts the newest run. bb rebuilt the check state from individual check runs and merged duplicates by name only. Four cancelled matrix jobs from the old run never expanded their names (for example `Tests (${{ matrix.shard }}, ubuntu-latest, Node 22.x)`), so no check in the new run shared their names, and bb counted them as failures. `gh pr checks` merges by name too and shows the same four failures. A second path had the same problem. When bb can't resolve the GitHub repository from git remotes, it found the PR with `gh pr view`. For drafts, closed PRs and failed GraphQL reads, it then used `gh`'s own `statusCheckRollup`, which has no workflow-run data. ## What changed `plugins/github-pr-status/host/git-host.ts`: - The GraphQL check query now fetches each check run's `checkSuite.workflowRun` (run number, event, workflow ID). After all check pages are merged, bb drops checks from any run superseded by a newer run of the same workflow and event. Runs for different events, such as `push` and `pull_request`, are both kept, so a real failure is not hidden. Status contexts and non-Actions check runs are unchanged. - The `gh pr view` discovery path now asks only for `--json url`, then reads the PR through the same GraphQL URL read every refresh uses. This now includes drafts and closed PRs. If that read fails, bb reports the PR as unavailable, which keeps any previous snapshot, instead of returning a partial PR. The `gh pr view` field list, its parser, and the `gh`-only parsing branches (array `reviewRequests`, `workflowName` fallback) are removed. This is host-local to the plugin. The host/server contract and `HOST_DAEMON_PROTOCOL_VERSION` are unchanged. ## How you verified - Added tests: - batch tests for a superseded run on one check page and for a newer run on a later page; - a discovery-path test for a draft with a superseded run; - a GraphQL-shaped normalization test; - unavailable cases for invalid or failed GraphQL responses. The superseded-run tests failed against the first draft of the fix, because the zod parse clones the check objects and dropped the run tags, so they do catch the bug. - `pnpm exec turbo run test typecheck lint --filter=bb-plugin-bb--github-pr-status`: 174 tests pass, plus typecheck and lint. - Read live #7000 with the patched host code: `passing`, 22/22, `ready_to_merge`. - Ran `pnpm start:worktree` with a checkout of #7000's branch as a project. `bb pull-request show` reports checks passing 22/22, `CLEAN`/`MERGEABLE`, `ready_to_merge`. Production bb on the same PR reports `failing (22 passed, 4 failed, 26 total)`, `checks_failed`. - Not exercised live: the discovery path for unresolvable remotes. It is covered by unit tests only. > AGENT GENERATED 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
scott/computer-use-cleanup
branch
from
November 4, 2026 20:30
9ace346 to
2e93787
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
The signed macOS desktop app is hardened but did not have the
com.apple.security.automation.apple-eventsentitlement or anNSAppleEventsUsageDescription. When the desktop app launches the bb server and host daemon, macOS treatsbb.appas the responsible process for everything they spawn, including agents' Computer Use helpers. Every Apple Event those helpers send is therefore checked against bb's signature, and TCC refuses them without prompting:AccessRequestIndirect: Policy disallows prompt for dev.bb.desktop; access to kTCCServiceAppleEvents denied. The most visible case is the event Codex'sturn-endednotifier sends to Codex Computer Use, which leaves the Computer Use cursor on screen after the turn ends (#2368).What changed
apps/desktop/build/entitlements.mac.plist: addcom.apple.security.automation.apple-events(main executable only).apps/desktop/electron-builder.config.json: addNSAppleEventsUsageDescriptiontomac.extendInfo.apps/desktop/test/electron-builder-config.test.ts: regression tests for both.Agents launched from the desktop app can now request Automation access. macOS still asks the user once per target app ("bb wants to control Codex Computer Use"). A denied request can be changed in System Settings > Privacy & Security > Automation. Codex.app ships the same entitlement.
Scope: this only covers hosts the packaged desktop app starts. Host daemons running as LaunchAgents under a separate Node executable are attributed to that executable, so this change does not affect them (#6730).
How you verified
main.pnpm exec turbo run test --filter=@bb/desktop -- test/electron-builder-config.test.tspasses, 25/25. The two new tests fail without the change.dev.bb.desktop, with the same signing team. Each ran with its own new data dir and was started from the desktop app, sobb.appwas the responsible process. Each ran a Codex thread that used Computer Use in Calculator. I reset the Apple Events permission before each run and sampled on-screen Computer Use windows every 0.5 s:turn-endedApple EventPolicy disallows prompt for dev.bb.desktop; ... deniedTCC RESULT: ... ACCESS GRANTEDbb thread stop): Codex does not sendturn-endedfor interrupted turns, so no Apple Event was sent. Stopping released the Codex runtime, and the Computer Use service exited with it. Window samples were not taken for the interrupt.Fixes #2368
Related: #6730 (LaunchAgent / Node-daemon hosts are not covered by this change).
🤖 Generated with Claude Code