Commit Graph

149052 Commits

Author SHA1 Message Date
Alex Dima
61627c8b44 Merge remote-tracking branch 'origin/main' into alexdima/fix-303531-sandbox-no-output-leak 2026-03-21 22:36:11 +01:00
Alex Dima
436b09abc3 Fix sandbox tests for Linux: handle different shell path and error message
- Handle /usr/bin/bash (Linux) vs /bin/bash (macOS) in /tmp write test
- Handle 'Read-only file system' (Linux) vs 'Operation not permitted' (macOS)
- Add 'Read-only file system' to outputLooksSandboxBlocked heuristic
- Replace newlines with spaces (not empty) to handle terminal wrapping
- Extract outputLooksSandboxBlocked as exported function with unit tests
2026-03-21 22:36:04 +01:00
Alex Dima
f4644120bc Cover case where the command is duplicated in stripCommandEchoAndPrompt 2026-03-21 22:28:19 +01:00
Alexandru Dima
c02137526e Use terminal-secure icon for sandboxed commands (#303778)
* Adopt new codicons version

* terminal: use terminal-secure codicon for sandboxed commands

Add per-invocation icon support to tool invocations via
`IPreparedToolInvocation.icon` and `IChatToolInvocation.icon`.
The terminal tool sets the icon to `terminal-secure` when sandbox
is active, or `terminal` otherwise. The thinking content part and
subagent content part use this icon when rendering, falling back
to the existing heuristic for tools without a registered icon.

Also removes the $(lock) theme icon prefix from sandbox invocation
messages since the icon now communicates the sandbox state.

* Fix unit test

* Review feedback
2026-03-21 22:15:48 +01:00
Alex Dima
cbc41b0485 Review feedback 2026-03-21 21:51:03 +01:00
Alex Dima
7517f8a3ee refactor: extract findCommandEcho and use prompt evidence to narrow trailing prompt regex matching 2026-03-21 21:44:03 +01:00
dileepyavan
ae0f754c98 Fix terminal sandbox tmp dir scoping (#303770) 2026-03-21 20:40:12 +00:00
Alex Dima
894596bbea Fix unit test 2026-03-21 21:34:54 +01:00
Alex Dima
d3d1f067e8 terminal: use terminal-secure codicon for sandboxed commands
Add per-invocation icon support to tool invocations via
`IPreparedToolInvocation.icon` and `IChatToolInvocation.icon`.
The terminal tool sets the icon to `terminal-secure` when sandbox
is active, or `terminal` otherwise. The thinking content part and
subagent content part use this icon when rendering, falling back
to the existing heuristic for tools without a registered icon.

Also removes the $(lock) theme icon prefix from sandbox invocation
messages since the icon now communicates the sandbox state.
2026-03-21 21:25:59 +01:00
Osvaldo Ortega
bb217020c0 Merge pull request #303343 from microsoft/osortega/steady-puma
Sessions: E2E test fixes
2026-03-21 14:17:48 -06:00
Alex Dima
0a0ba75021 Adopt new codicons version 2026-03-21 21:08:48 +01:00
Osvaldo Ortega
d811b6623c Fix assert 2026-03-21 14:01:17 -06:00
Osvaldo Ortega
e769150e8b Test fix 2026-03-21 13:32:14 -06:00
Osvaldo Ortega
a342d8ccc7 Merge branch 'main' of https://github.com/microsoft/vscode into osortega/steady-puma 2026-03-21 13:31:50 -06:00
Rob Lourens
896c13e4a8 Add unit test skill for vscode (#303766) 2026-03-21 19:10:48 +00:00
Alex Dima
f4c042bfc8 Relax some tests when shell integration is off 2026-03-21 19:56:04 +01:00
Alex Dima
22913a387d fix: detect sandbox failures heuristically when exit code is unavailable 2026-03-21 19:20:59 +01:00
Rob Lourens
146a2ea7e7 Human-readable remote agent host address (#303758) 2026-03-21 11:14:33 -07:00
Rob Lourens
6ae7d0c592 Fix workbench contrib warning (#303760) 2026-03-21 11:13:36 -07:00
Alex Dima
865568dbbc fix: Linux CI sandbox prereqs, platform-aware tests, broader prompt stripping
- Add bubblewrap and socat to Linux CI apt-get install
- Make sandbox test assertions platform-aware (macFileSystem vs linuxFileSystem)
- Make /etc/shells test accept both macOS and Linux first-line format
- Broaden wrapped prompt fragment regex to handle path chars (ts/testWorkspace$)
- Fix continuation pattern to match user@host:path wrapped lines
- Apply stripCommandEchoAndPrompt to getOutput() in BasicExecuteStrategy
  (basic shell integration lacks reliable 133;C markers so getOutput()
  can include command echo)
- Keep RichExecuteStrategy getOutput() unstripped (rich integration
  has reliable markers)
2026-03-21 19:06:50 +01:00
Alex Dima
5c733b67ac fix: handle macOS CI prompt format and add stripping to rich strategy
- Add trailing prompt patterns for hostname:path user$ (no @ sign)
- Handle wrapped prompt fragments like "er$" at line boundaries
- Add stripCommandEchoAndPrompt to RichExecuteStrategy marker fallback
- Context-aware wrapped prompt continuation detection
2026-03-21 18:50:17 +01:00
Alexandru Dima
5bd41fae60 Re-register run_in_terminal tool when sandbox settings change (#303748)
* Re-register run_in_terminal tool when sandbox settings change

When the terminal sandbox setting is toggled at runtime, the
run_in_terminal tool's schema and description were not updated because
the tool data was only computed once at startup. This meant the model
never learned about requestUnsandboxedExecution when sandbox was
enabled after startup.

Fix by using a MutableDisposable to manage the tool registration and
re-registering whenever sandbox-related settings, network domains, or
trusted domains change.

Fixes #303714

* Fix race condition in run_in_terminal tool re-registration and add refresh tests

Guard _registerRunInTerminalTool against stale async resolutions using a monotonically increasing version counter. Export ChatAgentToolsContribution for testability. Add integration tests verifying tool data refreshes on config and trusted domain changes.
2026-03-21 10:42:19 -07:00
Alex Dima
842c746bb2 fix: skip stale prompt fragments before command echo in stripping
In CI, ^C cancellations leave stale prompt fragments before the actual
command echo line. The leading-strip loop now continues scanning past
unmatched lines until it finds the command echo, instead of breaking
on the first non-matching line.
2026-03-21 18:35:26 +01:00
Alex Dima
d4359ab0d8 Review feedback 2026-03-21 18:07:41 +01:00
Alex Dima
a32b488b9d fix: tighten trailing prompt stripping to avoid dropping legitimate output
Anchor prompt-detection regexes to specific prompt shapes instead of
broadly matching any line ending with $, #, %, or >. This prevents
stripping real command output like "100%", "<div>", or "item #".
2026-03-21 18:05:15 +01:00
Alex Dima
31a4a74df7 Fix compilation errors 2026-03-21 17:58:07 +01:00
Alex Dima
34dd7810b7 fix: strip command echo and prompt from terminal output (#303531)
Prevent sandbox-wrapped command lines from leaking as output when

commands produce no actual output. Adds stripCommandEchoAndPrompt()

to isolate real output from marker-based terminal buffer captures.

Also adds configurable idle poll interval and shell integration

timeout=0 support for faster test execution.
2026-03-21 17:43:25 +01:00
Alexandru Dima
930498f060 Merge pull request #303720 from microsoft/fix/terminal-sandbox-instructions
Improve terminal sandbox instructions for LLM tool descriptions
2026-03-21 12:16:20 +01:00
Alex Dima
babe1c71b0 Address review feedback for terminal sandbox instructions
- Extract sandbox line generation into shared createSandboxLines() helper
- Compute effective allowed domains by filtering out denied domains
- Add sandbox/network domain instructions to PowerShell description
- Add tests for network domain inclusion and denied domain filtering
2026-03-21 11:49:56 +01:00
Alex Dima
2ed5b851eb Include allowed/blocked network domains in run_in_terminal tool instructions (#303582) 2026-03-21 10:59:54 +01:00
Alex Dima
0c86a6f765 Clarify sandbox retry prompts to instruct LLM to set requestUnsandboxedExecution=true directly (#303436) 2026-03-21 10:41:55 +01:00
dileepyavan
ac2da2ad98 Fixing incorrect rendering of invocation message in sandbox mode. (#303711)
rendering in markdown string
2026-03-21 09:30:56 +00:00
dileepyavan
b978bf74b2 tmp directory should not be used by sandboxed commands (#303699)
* Fix terminal sandbox tmp handling and upgrade sandbox runtime

Fixes #299224

Fixes #303568

* fixing test

* merging changes
2026-03-21 10:20:44 +01:00
Don Jayamanne
a1254fd4c2 update external tool invocations so terminal output renders (#303394) 2026-03-21 08:18:30 +00:00
dileepyavan
54be29cea7 Merge pull request #303618 from microsoft/DileepY/303505
Include analyzer messages in background terminal output
2026-03-21 08:14:24 +01:00
Rob Lourens
9d7d0363de When archiving active session, clear it (#303684) 2026-03-20 22:23:12 -07:00
Rob Lourens
55969564bb Enable setting caseInsensitive through search API for agent tools (#303679)
* Enable setting caseInsensitive through search API for agent tools
Fix #303673

* Avoid per-call allocation in isFilePatternMatch for ignoreCase option (#303681)

* Initial plan

* Extract filePatternIgnoreCaseOptions as module-level constant to avoid per-call allocations

Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/a131b260-e6c0-47f6-aa2a-95ac0f24fe10

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
2026-03-21 04:45:05 +00:00
Peng Lyu
161ff4266e carousel: improve image loading perf (#303662)
* carousel: improve image loading perf

* resolve comments
2026-03-20 19:43:51 -07:00
dileepyavan
36ca95ebaa Show allow-list actions for unsandboxed terminal confirmations (#303660)
* Handle unsandboxed terminal confirmation actions

* test: fix unsandboxed terminal confirmation actions

* Fixing confirmation window issues outside sandbox
2026-03-20 19:41:15 -07:00
Rob Lourens
7503e59fc3 Don't localize markdown icon syntax (#303655)
* Don't localize markdown icon syntax

Co-authored-by: Copilot <copilot@github.com>

* Add eslint rule for localized markdown icons

---------

Co-authored-by: Copilot <copilot@github.com>
2026-03-21 01:19:54 +00:00
Kyle Cutler
7c45bc769a Fix browser focus stealing (#303647) 2026-03-21 00:53:04 +00:00
Matt Bierner
8c3724e8d1 Merge pull request #303644 from mjbvz/dev/mjbvz/fine-dingo
Mark many chat session related types as readonly
2026-03-20 17:49:38 -07:00
dileepyavan
28aaabc31e Option to allow-list command when offering to run outside of sandbox (#303637)
* Handle unsandboxed terminal confirmation actions

* test: fix unsandboxed terminal confirmation actions
2026-03-20 17:40:55 -07:00
Paul
1519062c0f Add missing skills discovery info (#303646) 2026-03-21 00:31:33 +00:00
Josh Spicer
4b8a157d86 Replace gear menu with direct Customizations editor action (#303641)
When chat.customizationsMenu.enabled is true (default):
- Gear icon directly opens the AI Customizations editor
- Tool Sets, Chat Settings, and Show Agent Debug Logs move to the '...' context menu

When the setting is false, the original gear dropdown behavior is preserved.
2026-03-21 00:19:49 +00:00
Rob Lourens
a7fffd156c Enable starting sessions on remote agent hosts in sessions app (#303631)
* Enable starting sessions on remote agent hosts in sessions app

Co-authored-by: Copilot <copilot@github.com>

* Fix

Co-authored-by: Copilot <copilot@github.com>

* fix

Co-authored-by: Copilot <copilot@github.com>

* fix

Co-authored-by: Copilot <copilot@github.com>

* fix test

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <copilot@github.com>
2026-03-20 17:16:33 -07:00
Paul
2a09c1e0d0 Use built-in progress instead of custom shimmer for agent debug panel (#303636) 2026-03-21 00:04:58 +00:00
Matt Bierner
caa7e57116 Also mark array itself as readonly 2026-03-20 17:01:11 -07:00
Matt Bierner
c2b719fb32 Add one more readonly 2026-03-20 17:00:12 -07:00
Matt Bierner
4631c88d06 Update test 2026-03-20 16:59:21 -07:00