Skip to content

fix: correct terminal sandbox icon in thinking dropdown#304327

Merged
alexdima merged 2 commits intomainfrom
alexd/administrative-landfowl
Mar 24, 2026
Merged

fix: correct terminal sandbox icon in thinking dropdown#304327
alexdima merged 2 commits intomainfrom
alexd/administrative-landfowl

Conversation

@alexdima
Copy link
Member

When sandbox is enabled, the tool-level icon was set to terminalSecure (lock) at registration time, which leaked into every rendering path during streaming before we knew if a specific command was actually sandboxed. This caused unsandboxed commands (requestUnsandboxedExecution=true) to show the lock icon.

Fix:

  • Set toolData.icon to always be Codicon.terminal (no lock). The per-command isSandboxWrapped flag in toolSpecificData is the authoritative source.
  • In the existing autorun in trackToolMetadata, update the icon element when the tool transitions out of streaming and toolSpecificData becomes available.
  • Store icon elements in toolIconsByCallId map for direct access.

Fixes #303505

When sandbox is enabled, the tool-level icon was set to terminalSecure (lock)
at registration time, which leaked into every rendering path during streaming
before we knew if a specific command was actually sandboxed. This caused
unsandboxed commands (requestUnsandboxedExecution=true) to show the lock icon.

Fix:
- Set toolData.icon to always be Codicon.terminal (no lock). The per-command
  isSandboxWrapped flag in toolSpecificData is the authoritative source.
- In the existing autorun in trackToolMetadata, update the icon element when
  the tool transitions out of streaming and toolSpecificData becomes available.
- Store icon elements in toolIconsByCallId map for direct access.

Fixes #303505
Copilot AI review requested due to automatic review settings March 24, 2026 01:09
@alexdima alexdima enabled auto-merge (squash) March 24, 2026 01:09
@alexdima alexdima self-assigned this Mar 24, 2026
@vs-code-engineering vs-code-engineering bot added this to the 1.114.0 milestone Mar 24, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an incorrect “sandbox/lock” icon being shown for unsandboxed Run in Terminal invocations in the chat “thinking” dropdown by decoupling the tool’s registered icon from per-invocation sandbox state, and updating the rendered icon once invocation-specific data becomes available.

Changes:

  • Set Run in Terminal tool registration icon to always use Codicon.terminal (no lock), regardless of sandbox enablement.
  • Track per-tool-call icon elements in the thinking UI and update the icon when a tool transitions out of streaming and terminal toolSpecificData is available.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts Ensures the registered tool icon is always the non-lock terminal icon to avoid misleading streaming UI.
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.ts Adds tracking for icon DOM nodes and updates terminal icons post-streaming based on isSandboxWrapped.

Copy link

@marsam2489-lang marsam2489-lang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to start.

@alexdima alexdima merged commit 5d82d8a into main Mar 24, 2026
19 checks passed
@alexdima alexdima deleted the alexd/administrative-landfowl branch March 24, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Background commands don't get their output massaged with sandbox info

4 participants