fix(computer-use): enforce background-only policy - #14
Merged
BenSheridanEdwards merged 2 commits intoAug 21, 2026
Merged
Conversation
6 tasks
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.
Why does this feature exist?
Native computer-use should not be able to take over an actively used desktop when an agent/profile is configured for background-only operation.
Hermes previously treated background delivery as a default rather than an enforceable policy. Explicit foreground delivery, bring-to-front, or
focus_app(..., raise_window=True)could still reach approval and backend dispatch.What changed?
computer_use.background_onlyas a fail-closed policy boundary for foreground intent.delivery_mode="foreground",bring_to_front=true, andfocus_app(..., raise_window=true)before approval and before backend startup.load_config_readonly()so config remains mtime-aware without deep-copying the full config on every computer-use request.Behavioural Proof (with video and screenshots)
No visual proof is required for this change. The diff changes dispatcher policy and tests only. It does not alter runtime UI, layout, copy, screenshots, capture rendering, or overlay presentation.
Behavior is proven by deterministic dispatcher tests:
code: foreground_disabled;A live foreground demonstration would deliberately perform the behavior this PR is designed to prohibit and would disturb the active desktop, so it is intentionally excluded.
Verification Summary
Focused tests
Broader computer-use suite
The sole failure is
TestCaptureAppFilterNoMatch::test_linux_default_capture_skips_gnome_shell_helper, a Linux/GNOME window-selection test run on macOS. The exact test fails identically on the feature parent, so it is baseline/platform debt rather than an introduced regression.Performance gate
100,000 calls per implementation, same process, same cached config:
load_config()gateload_config_readonly()gateThe optimized gate removes 348.68 µs median from the initial implementation, a 94.4% reduction. Its remaining 20.54 µs median overhead is negligible relative to IPC, capture, AX traversal, or browser operations.
Rollout plan
No gateway restarts are performed by this PR.