terminal: reduce sandbox URL false positives#308894
Merged
dileepyavan merged 1 commit intomainfrom Apr 10, 2026
Merged
Conversation
Restrict bare host detection to a conservative set of coding-related domain suffixes while continuing to treat explicit URLs and SSH remotes as domains. Add regression coverage for valid and invalid bare suffixes, multi-label hosts, explicit URLs, and dotted non-domain identifiers.
Contributor
There was a problem hiding this comment.
Pull request overview
Reduces false positives in TerminalSandboxService’s heuristic domain extraction so sandbox prompts aren’t triggered by arbitrary dotted identifiers (eg session.completed), while still treating explicit URLs and SSH remotes as network domains.
Changes:
- Add a conservative allowlist of “well-known” domain suffixes for bare host detection.
- Keep treating URL authorities and SSH remotes as domains even when the suffix looks uncommon/file-like.
- Add regression tests for unknown bare suffixes, multi-label hosts, and explicit URL authorities.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts | Tightens bare-host normalization by requiring a well-known suffix (when not parsed from a URL/SSH remote). |
| src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/terminalSandboxService.test.ts | Adds tests validating the new bare-host heuristic and ensuring explicit URLs still trigger domain checks. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 2
bryanchen-d
approved these changes
Apr 9, 2026
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.
Summary
Testing
npm run transpile-clientnpm run test-browser-no-install -- --browser chromium --grep "TerminalSandboxService - network domains"gulp hygiene(fails on unrelated pre-existing/generated file:extensions/mermaid-chat-features/chat-webview-out/codicon.css: Missing or bad copyright statement)Fixes #308785