Repository navigation
Conversation
macOS caches TCC decisions per process. A Computer Use helper that was started before the user granted Screen Recording or Accessibility keeps being denied even after the grant, so the only way to pick the authorization up today is restarting the whole desktop app. Add a "restart" action to the control protocol: the desktop host stops the live helper and starts a fresh one, answering with its capability. Expose it to the backend as HostRuntimeProvider.restart_helper(), which also retires the cached capability and the environment bootstrap (both name the old helper's endpoint) whether or not the replacement comes up, and caches the new capability when it does.
chenzier
had a problem deploying
to
ai-review-approved
September 7, 2026 12:44 — with
GitHub Actions
Failure
|
Hi @chenzier, thank you for your first Pull Request! 🎉 🙌 Join Developer CommunityThanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page: We truly appreciate your enthusiasm—and look forward to your future contributions! 😊 We'll review your PR soon. |
chenzier
had a problem deploying
to
maintainer-approved
September 10, 2026 09:03 — with
GitHub Actions
Failure
This branch had an error being deployed
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.


Description
On macOS, TCC decisions (Screen Recording, Accessibility) are cached per process. A Computer Use helper that was started before the user granted those permissions keeps being denied even after the grant lands in System Settings — the running helper simply never sees it. Today the only way to make the authorization take effect is restarting the whole desktop app.
This PR adds a
restartaction to the computer-use control protocol:computer_use_runtime.rs): onrestart, stop the live helper and start a fresh one, answering with the new capability. Reuses the existingstop_helper/ensure/runtime_capabilityprimitives; follows the same response shape asacquire.app/computer_use/runtime.py): exposeHostRuntimeProvider.restart_helper(). It retires the cached capability and the environment bootstrap (both name the old helper's endpoint) whether or not the replacement comes up, and caches the new capability when it does — so a failed restart degrades to the existingacquire-again recovery path instead of handing out a dead endpoint. The response parsing is extracted into_capability_from_response()and shared with_request_capability().test_capability_recovery.pycovering the replace-success, failed-restart-stops-answering-with-the-old-endpoint, and no-control-endpoint paths.The intended call site is any consumer that observes a permission-denied result from the helper: record that a TCC grant is pending, wait for the user to authorize, then call
restart_helper()before the next operation instead of asking the user to relaunch the app.Type of Change
Component(s) Affected
Checklist
pre-commit run --all-fileslocally and it passespytestor as relevant) and they passTesting
Reproducing the original problem on macOS:
With this change, calling
HostRuntimeProvider.restart_helper()after the grant replaces the stale helper and returns a working capability.Verified locally:
Evidence
tests/unit/plugins/computer_use/test_capability_recovery.pygains three regression tests for the restart path (capability replaced, stale endpoint retired on failure, no-control-endpoint guard).acquirebranch (stop →ensure→runtime_capability), and the existingcomputer_use_runtimeunit tests still pass after the new match arm.Security Considerations
The new control action is authenticated by the same control-token check as every other action and only restarts a helper process that this host already manages; no new listening surface or privilege is introduced.