Repository navigation
fix: gate Update All Agents on workspace trust - #24
Merged
Merged
Conversation
The bulk update command called runAgentUpdate directly for agents without custom environment values and never checked vscode.workspace.isTrusted, so it could run package-manager update commands in an untrusted workspace and bypass the guard enforced by the per-agent update and launch paths. Extract the duplicated trust prompt into confirmWorkspaceTrust (pure, unit-tested via an injected UI surface) plus createWorkspaceTrustPrompt, use it in launchAgent, updateAgent, and at the start of superCli.updateAllAgents, and cover the gate with unit tests and a metadata wiring assertion.
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.
Problem
SCL-1 from
reviews/github-2026-10/code-review/CODE-REVIEW.md: Super CLI: Update All Agents (src/extension.ts:598-673) calledrunAgentUpdatedirectly for agents without custom environment values and never checkedvscode.workspace.isTrusted. Every other path that runs terminal commands (launchAgent,updateAgent) enforced the gate, so the bulk command could bypass it and run package-manager update commands in an untrusted workspace, contradictingcapabilities.untrustedWorkspaces.Change
confirmWorkspaceTrustinsrc/command-utils.ts(pure module, UI injected so it stays unit-testable) andcreateWorkspaceTrustPromptinsrc/terminal.ts.launchAgent,updateAgent, and at the start ofsuperCli.updateAllAgents, before the agent list is resolved or any terminal is created.Manage Workspace Trust,Open Settings) as the other paths.updateAgentnow also offersOpen Settings, matchinglaunchAgent(previously only the trust action).Tests
test/trust-gate.test.js: a trusted workspace proceeds without prompting; an untrusted workspace refuses to start and shows the warning; both actions are wired.test/metadata.test.js: pins that the bulk command calls the gate before resolving agents and that the VS Code prompt readsworkspace.isTrustedlazily.Verification
npm cinpm run typecheck— passnpm test(122 unit tests) — passnpm run check(compile + unit + real VS Code Extension Development Host integration +vsce ls) — passnpm pack --dry-run— pass (126 files)No version bump, no release.