Diff Delta:
3104
About 411 Diff Delta/hour
Classified as:
Feature Add
Giuspepe's Description of Work
Why
Computer Use currently asks for macOS Accessibility and Screen Recording with a new question card at every step. This PR replaces those cards with one setup modal. It shows the verified state of both permissions and lets the waiting task continue once both are on.
What changed
- The local macOS Agent Host turns the plugin's permission prompts into one setup per waiting turn and publishes it as
vscode.computerUse.status. Clients act throughvscode.computerUse.request, and chat shows one card that opens the modal. - The Agent Host checks Accessibility again as soon as macOS posts
com.apple.accessibility.api, so the row turns on without a click. - For the System Settings step, the modal offers the helper app as a native drag into the permission list, plus Show in Finder. It shows the app's own icon, read from its
.icnsfile.
Scope
- Covers macOS desktop windows for local Copilot sessions. Other clients and hosts keep the plugin's questions, and no Agent Host Protocol types change.
- Screen Recording is still checked when the window regains focus, because macOS reports that grant only to a new process.
- A real mouse drag into System Settings and a real Accessibility toggle are untested. Live checks posted the notification by script.
Tradeoffs
- Polling the plugin's permission check was rejected. Its helper treats the Agent Host as an untrusted parent and shows an alert on every connection.
- Electron's
app.getFileIconreturns at most 64 px and hung the main process at the large size, so the Agent Host reads the PNG from the app's icon file.
Blast Radius
Chat shows the setup card only for the local Agent Host in a macOS window. IDialogOptions.renderIcon and INativeHostService.startFileDrag change nothing until a caller uses them, and the main process listens for one macOS notification while the Agent Host runs.
Verification
- Tests, types and layers pass:
sh
./scripts/test.sh --run src/vs/platform/agentHost/test/common/computerUse.test.ts --run src/vs/platform/agentHost/test/node/copilotComputerUsePlugin.test.ts --run src/vs/platform/agentHost/test/node/copilotComputerUsePermissionSetup.test.ts --run src/vs/workbench/contrib/chat/test/browser/agentSessions/computerUseSetupDialog.test.ts --run src/vs/base/test/browser/ui/dialog/dialog.test.ts # 46 passing
./scripts/test.sh --run src/vs/platform/agentHost/test/node/agentService.test.ts # 1306 passing, 16 pending
./scripts/test.sh --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts --run src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts --grep "[Cc]omputer [Uu]se|ComputerUse" # 16 passing
npm run typecheck-client # passed
npm run valid-layers-check # passed
ESLint, Stylelint and the pre-commit hygiene check report nothing on the changed files. - Drove the real modal in Code OSS against a live Agent Host through the first round, a running step, the System Settings step, an error, ready and ended. Tab reaches every control. Outlines measure about 1.3:1 against the dialog in the default light and dark themes, and high contrast themes use their contrast border.
- To try it on macOS, turn on
chat.agentHost.computerUse.enabled, run/computer onin a local Copilot chat, and ask it to use an app. Set Up Computer Use in the Command Palette opens the modal any time.
43 total changed files
(1 file ignored)
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
You've reached the end of this PR review
Like the credits, but with fewer stunts.