Skip to content

fix(macos): restore browser and native Computer Use helpers - #164

Merged
mouzhi merged 4 commits into
mainfrom
fix/macos-native-tools
Sep 5, 2026
Merged

mouzhi merged 4 commits into
mainfrom
fix/macos-native-tools

Conversation

@mouzhi

@mouzhi mouzhi commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Restore macOS Chrome policy-verification startup and native Computer Use while preserving codexhost's main Desktop and SSH Host routing.

Related to #160. The user has verified in-app browsing in a local Mac Desktop task (navigation, reading, and button interaction). This PR does not claim to fix #130 / remote in-app browser discovery: the SSH test task still does not expose a matching IAB backend. Browser session matching is unchanged.

Root causes and changes

  1. Isolated browser helpers preserve only CODEX_CLI_PATH. The macOS Shim previously exited with CODEXHOST_STOCK_CODEX_PATH is required before the official CLI could verify policy. Extend the exact-self-override fallback to macOS using validated official Desktop bundle discovery; explicit invalid installation roots and unrelated CLI overrides remain errors, and PATH is never searched.
  2. Native Computer Use inherits the full managed Desktop environment. Its auxiliary app-server entered Host ownership instead of using the stock CLI. macOS LaunchServices reparents Desktop to launchd, so the Windows launcher-ancestor heuristic does not apply. Verify the live Launcher executable and bounded, start-time-checked ancestry to the exact Desktop in the official CLI's validated bundle. Direct Desktop children retain Host routing; only nested helpers use stock with Host bootstrap variables removed.

Official policy, authentication, approvals, app-use restrictions, and browser session matching remain unchanged. No official app/plugin binary or live credentials are included.

Validation

  • Reproduced real Mac helper startup: old candidate exits in 5ms with missing stock-path error; supplying just the explicit stock path initializes successfully. Fixed Shim initializes with only its standard CLI override.
  • Regression test observed failing before fix, then passing for isolated helper startup. Negative tests cover unrelated overrides, missing stock override, and absent installation without PATH fallback.
  • Real process regression verifies direct and nested native helper routing, including a Desktop fixture reparented to launchd, and no helper Host ownership lock.
  • Windows: npm run format:check, npm run lint, npm run typecheck, npm run test:typescript (2309 passed, 18 skipped), npm run check:rust passed.
  • macOS: workspace Clippy -D warnings and all workspace Rust tests passed, including 40 Shim process tests. TypeScript and renderer build plus arm64 release packaging passed.
  • macOS deployed diagnostic candidate 0.5.0-macos-native.2: native getState/application enumeration passed; Calculator UI click sequence 2 + 3 = read back 5; Chrome created Example Domain, read accessibility content, clicked Learn more, and read the IANA destination. No policy bypass.
  • Actual desktop Launcher/Shim/Controller/Host Runtime and Remote Host use the candidate. One desktop Controller and one desktop Host Runtime; Remote Host ready and Aqua broker running with matching plist. SSH debug task resumed across restarts and completed multiple real tool turns. Remote initialize/thread-read/configRequirements-read passed.
  • User-provided local Mac Desktop test and screenshot: opened Example Domain, read page content, navigated to the Add/Remove Elements test page, and clicked Add Element to display a new Delete button. This confirms a successful local task submission and local IAB interaction; evidence is user-provided, distinct from the agent-run SSH tests above. The screenshot is not uploaded because it contains unrelated task names.
  • GitHub CI on head 54cded050f2fea9faf7bda831a529fe4487fcf2a: Ubuntu 22.04, macOS 14, Windows, and Linux ARM64 all passed. Two independent local code-review passes were reconciled against the current head with no remaining evidenced blockers; these are not GitHub maintainer approvals.

Verification boundaries

  • Local Desktop IAB and task submission passed via the user's direct test. Local task resume across a restart was not separately exercised; SSH task resume was exercised. No further restart was performed solely to extend local coverage.
  • SSH IAB exposure remains unverified/unavailable in the dedicated test task, not a demonstrated universal SSH limitation. No alternative UI-control or session-matching bypass is used.
  • Other Harness implementations were not changed; this verification does not claim a fresh end-to-end run of every optional Harness.

The previous stable and PR163 candidates are preserved for rollback. This is a candidate deployment, not a stable release.

@mouzhi
mouzhi marked this pull request as ready for review September 5, 2026 13:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T14:09:04.670535Z 54cded0 Manual request
🔒 Security Review 🔄 Running since 2026-09-05T14:05:25.559487Z 54cded0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mouzhi

mouzhi commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 54cded050f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

Security review completed. No security issues were found in this pull request.

Reviewed commit: 54cded050f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] In-app Browser is not discoverable when Codex Desktop is launched through codexhost

1 participant