Commit Graph

1467 Commits

Author SHA1 Message Date
Megan Rogge 4d75b7af01 fix: disable data-idle fallback for sync terminal commands (#313589) 2026-04-30 22:36:07 +00:00
Johannes 41f67815ee api: merge module interceptors for esm and node 2026-04-30 15:14:52 +02:00
dileepyavan c810f47714 Sandbox_integration: Skipping sandbox integration tests to unblock. (#312537)
* adding allowRead and testing with defaults

* Rename terminal sandbox read allow list

* Remove Copilot settings change from sandbox PR

* changes

* changes

* Updating sandbox runtime package

* Updating tests

* Add macOS test cases for denyRead/allowRead behavior and ~ path handling

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/ec5cf3c2-6c7b-4577-bdbb-8ac3d42bdfb0

Co-authored-by: dileepyavan <52841896+dileepyavan@users.noreply.github.com>

* changes for readonly home dir

* skipping integrated tests for sandbox

* running srt in tmp_dir for linux

* running srt in tmp_dir for linux

* skipping failed integration test in linux

* fixing test failures

* fixing test failures

* skipping integration tests in CI pipeline

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-25 17:06:24 +00:00
dileepyavan bb09e7379b terminal: Disable read all by default (#311850)
* adding allowRead and testing with defaults

* Rename terminal sandbox read allow list

* Remove Copilot settings change from sandbox PR

* changes

* changes

* Updating sandbox runtime package

* Updating tests

* Add macOS test cases for denyRead/allowRead behavior and ~ path handling

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/ec5cf3c2-6c7b-4577-bdbb-8ac3d42bdfb0

Co-authored-by: dileepyavan <52841896+dileepyavan@users.noreply.github.com>

* changes for readonly home dir

* skipping integrated tests for sandbox

* running srt in tmp_dir for linux

* running srt in tmp_dir for linux

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-24 11:07:16 -07:00
Kyle Cutler 853d2d9a4f Refactor browser creation flow, add ownership model (#312166)
* Refactor browser creation flow, add ownership model

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

* Opening in background

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

* feedback

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

* simplify

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

* fix

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

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-23 14:42:08 -07:00
Matt Bierner de7206fad5 Merge branch 'main' into dev/mjbvz/wonderful-piranha 2026-04-19 20:14:50 -04:00
Kyle Cutler e60d312067 Add browser tool smoke tests (#311123)
Co-authored-by: Copilot <copilot@github.com>
2026-04-18 00:19:35 +00:00
dileepyavan 9684342937 Disabling flaky test for sandbox (#311113)
disabling flaky test for sandbox
2026-04-17 23:41:30 +00:00
Kyle Cutler 3704d95c91 Support frames / workers in browser CDP (#311049)
* Support frames / workers in browser CDP

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

* path fix

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

* feedback

* Normalize blank URLs

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

---------

Co-authored-by: Copilot <copilot@github.com>
2026-04-17 11:47:17 -07:00
dileepyavan de858c03e4 Improve terminal unsandbox retry confirmation (#309671)
* Show unsandboxed retry in chat terminal

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fixing failed tests

* fixing tests

* Remove automatic unsandbox retry note

* Improve terminal unsandbox retry confirmation

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-13 19:41:28 -07:00
João Moreno 91c7ec5681 fix: unskip chat tests (#309228) 2026-04-12 08:48:56 -07:00
dileepyavan d37d08cda0 Show automatic unsandbox retries in the chat terminal UI (#308655)
* Show unsandboxed retry in chat terminal

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fixing failed tests

* fixing tests

* Remove automatic unsandbox retry note

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-11 21:52:46 -07:00
Dmitriy Vasyura 865a331340 Add agent network filter policy settings (#308434) 2026-04-10 23:31:42 +00:00
Christof Marti bd9c0c4919 Fix flaky test 2026-04-08 08:13:59 +00:00
João Moreno d4bb7b41ba getting ready to merge 2026-04-06 20:18:35 +02:00
João Moreno 9f64381092 skip test suite 2026-04-06 14:14:08 +02:00
João Moreno 92560ee581 another test skip 2026-04-06 09:49:41 +02:00
João Moreno 1d23f25ecc skip flaky test 2026-04-06 07:55:21 +02:00
João Moreno 75fea1b777 Merge remote-tracking branch 'origin/main' into joao/copilot-builtin 2026-04-05 20:39:32 +02:00
dileepyavan cc9f34504b Rename agent sandbox settings (#307237)
* Rename agent sandbox settings

* refactoring for review comments

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.ts

Update for deprecation

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-04-01 20:56:32 +00:00
Anthony Kim 54b695e02e Add windowsUseConptyDll setting to runInTerminal tests (#307185) 2026-04-01 10:49:44 -07:00
Megan Rogge a9ccde3863 Terminal tools: replace isBackground with mode=sync|async, remove await_terminal tool (#307141) 2026-04-01 11:40:36 -04:00
Alex Ross 82ec78a528 Disable more flaky tests (#307102) 2026-04-01 14:19:38 +02:00
Megan Rogge 6c3a002c90 remove shell integration none tests (#306932) 2026-03-31 14:30:41 -07:00
João Moreno b92bbb8e27 skip self signed cert test 2026-03-31 17:25:40 +02:00
Alex Ross 8906163852 Skip flaky terminal test (#306668) 2026-03-31 20:23:15 +11:00
Megan Rogge 61e3ba6f04 skip flakey sandbox test for now (#306417)
part of #305722
2026-03-30 21:57:09 +00:00
dileepyavan a2d7b9e13b [Sandbox] Notify user to run out of sandbox if the domain is not included in allowedDomains. (#306121)
* Rename sandbox setting to chat.agent.sandbox (#303421)

Rename the top-level sandbox setting from `chat.tools.terminal.sandbox.enabled`
to `chat.agent.sandbox` to reflect that sandboxing is a general agent concept,
not terminal-specific.

- Update setting ID value to `chat.agent.sandbox`
- Update description to be more general
- Deprecate old `chat.tools.terminal.sandbox.enabled` setting
- Update telemetry event name

Fixes #303421

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* updating terminal sandbox to agent sandbox

* removed allowTrustedDomains

* correcting the settings keys for sandboxing

* correcting the settings keys for sandboxing

* Explicit notification for blocked domains before running the command

* Fix terminal sandbox follow-ups

* main merge

* fixing tests

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Revert "Update src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.ts"

This reverts commit b956dfa719.

* removing local files

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-30 15:33:04 +02:00
dileepyavan 57d9535056 Rename sandbox setting to chat.agent.sandbox (#303421) (#305846)
* Rename sandbox setting to chat.agent.sandbox (#303421)

Rename the top-level sandbox setting from `chat.tools.terminal.sandbox.enabled`
to `chat.agent.sandbox` to reflect that sandboxing is a general agent concept,
not terminal-specific.

- Update setting ID value to `chat.agent.sandbox`
- Update description to be more general
- Deprecate old `chat.tools.terminal.sandbox.enabled` setting
- Update telemetry event name

Fixes #303421

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* updating terminal sandbox to agent sandbox

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-29 01:31:02 +00:00
dependabot[bot] e49f2d1a54 Bump node-forge from 1.3.2 to 1.4.0 in /extensions/vscode-api-tests (#305343)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.3.2 to 1.4.0.
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.3.2...v1.4.0)

---
updated-dependencies:
- dependency-name: node-forge
  dependency-version: 1.4.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 14:15:43 -07:00
dileepyavan 6afe980a82 Preserve $TMPDIR when retrying terminal commands outside the sandbox (#304601)
* Changes to include environment variables for retry without sandboxing

* adding e2e tests

* fixing code formatting
2026-03-27 05:49:29 +00:00
Megan Rogge c4f707a8a4 tweak run_in_terminal changes (#304843) 2026-03-26 21:23:26 +00:00
Alexandru Dima 3460bdb15c Fix command rewriting issues when terminal sandboxing is enabled (#303859)
* fix: command rewriting issues when terminal sandboxing is enabled

Fixes two issues with sandboxed terminal commands:

1. Sandboxed commands end up in shell history (#303769): The
   PreventHistoryRewriter was running before SandboxRewriter, so the
   leading space was applied to the inner command but not the final
   sandbox-wrapped command. Moved PreventHistoryRewriter to run last.

2. cd CWD prefix not stripped in sandbox mode (#303848): The
   SandboxedCommandLinePresenter was using the original (un-rewritten)
   command for display, bypassing cd prefix stripping. Changed to use
   forDisplay instead.

3. Fixed forDisplay being clobbered: The rewriter loop unconditionally
   overwrote forDisplay, so later rewriters without a forDisplay
   (like PreventHistoryRewriter) would clear the sandbox's display
   value. Changed to only update when explicitly provided.

Fixes #303769
Fixes #303848

* update doc comment for SandboxedCommandLinePresenter

* improve execute strategy logging for CI diagnostics

Upgrade strategy selection and completion logs to info level in
runInTerminalTool. In richExecuteStrategy, log at info level when
running in CI (for diagnosing shell integration race conditions)
and debug otherwise.

* fix: include ignorespace in bash shell integration history verification

When VSCODE_PREVENT_SHELL_HISTORY=1 is set (which it is for all tool
terminals created by the run_in_terminal tool), the bash shell
integration script sets HISTCONTROL="ignorespace" (line 67). This
causes bash to exclude space-prefixed commands from history.

Later in the same script (line 200), a regex decides whether to use
`history 1` or $BASH_COMMAND to capture the current command in
__vsc_preexec. The regex checks for erasedups, ignoreboth, and
ignoredups — but NOT ignorespace. This is a bug because:

1. The same script sets HISTCONTROL=ignorespace 130 lines earlier
2. ignoreboth (which IS in the regex) is defined by bash as
   "ignorespace + ignoredups" — so the compound form was handled
   but the simple form was not

The consequence: with HISTCONTROL=ignorespace and __vsc_history_verify=1,
__vsc_preexec calls `history 1` to get the current command. But the
command has a leading space (added by PreventHistoryRewriter), so bash
history never recorded it. `history 1` returns the PREVIOUS command
or nothing. This causes __vsc_current_command to be wrong or empty.

In __vsc_command_complete, when __vsc_current_command is empty, the
script sends the OSC sequence 633;D WITHOUT an exit code (line 373).
The VS Code side then receives onCommandFinished with exitCode=undefined,
breaking exit code detection for ALL tool terminal commands on bash.

The fix adds ignorespace to the existing regex, so bash falls back to
$BASH_COMMAND (which always works regardless of history settings).
This matches the behavior already provided when ignoreboth is set.

* docs: improve fix-ci-failures skill with faster log retrieval workflow
2026-03-22 18:04:12 +01:00
Alexandru Dima ca117fbb4f Accept "Command produced no output" when shell integration is off (#303866)
Accept "Command produced no output" when shell integration is off (#303865)
2026-03-22 14:36:27 +00:00
Alex Dima 487646cee8 Attempt to cover up the run_in_terminal tool not being registered quickly 2026-03-22 10:50:35 +01:00
Alexandru Dima 5563927f89 Fix terminal output capture: prevent premature idle detection and handle partial command echoes
- setupRecreatingStartMarker returns IDisposable to stop marker recreation
  before sending commands (prevents marker jumping on PSReadLine re-renders)
- noneExecuteStrategy waits for cursor to move past start line after sendText
  before starting idle detection (prevents end marker at same line as start)
- findCommandEcho supports suffix matching for partial command echoes from
  wrapped getOutput() results (shell integration ON with long commands)
- Suffix matching requires mid-word split to avoid false positives on output
  that happens to be a suffix of the command (e.g. echo output)
- Integration tests: use ; separator on Windows, add && conversion test,
  handle Windows exit code quirks with cmd /c
2026-03-22 00:46:48 +01:00
Alex Dima 4ed68ee36f Fix slash history test 2026-03-21 23:23:32 +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
Alex Dima f4c042bfc8 Relax some tests when shell integration is off 2026-03-21 19:56:04 +01: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 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
Kyle Cutler 3f4f33b7da Fix close tracking in browser API (#303304) 2026-03-19 13:47:36 -07:00
Kyle Cutler 0bc4bad6ef Proposed browser API for debug support (#300577)
* Proposed browser API for debug support

* build, feedback

* Web stubs

* fix

* close guard

* fixes, add close()

* clean

* Fixes, tests

* lint

* Simplfiy

* feedback
2026-03-13 16:32:58 +01:00
Matt Bierner e9b82791e6 Commit other npmrc files 2026-03-10 20:56:09 -07:00
Don Jayamanne 5b38f1d529 Update default model selection to prioritize 'copilot' vendor in ExtHostLanguageModels (#298903)
* Update default model selection to prioritize 'copilot' vendor in ExtHostLanguageModels

* Fix tests

* Fix tests
2026-03-06 21:48:45 +11:00
Don Jayamanne 284bd98ce3 Add support for custom chat agents in the API (#298227)
* Add support for custom chat agents in the API

- Introduced `chatCustomAgents` proposal in extensions API.
- Implemented methods to handle custom agents in `MainThreadChatAgents2`.
- Added `ICustomAgentDto` interface and related functionality in extHost.
- Created new type definitions for custom agents in `vscode.proposed.chatCustomAgents.d.ts`.

* Filter custom agents by visibility before pushing to the proxy

* Refactor onDidChangeCustomAgents to use direct event listener

* Update custom agent tools property to allow undefined values

* Add chatCustomAgents to enabledApiProposals in package.json

* update

* update

* support skills

* support instructions

* update

* update

---------

Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
2026-03-04 13:38:47 +00:00
Alex Ross 856ea291a5 No need to throw when an element with the same ID comes in (#299154)
* No need to throw when an element with the same ID comes in
Fixes microsoft/vscode-pull-request-github#8073

* Fix tests
2026-03-04 13:50:35 +01:00
Dmitriy Vasyura e395fe2993 Finalize env.isAppPortalable API proposal (#297177) 2026-02-24 11:43:00 -08:00
Matt Bierner cc10bc708e Enable incremental builds to speed up updates after first build 2026-02-19 14:14:37 -08:00