Commit Graph

1442 Commits

Author SHA1 Message Date
Megan Rogge
6c3a002c90 remove shell integration none tests (#306932) 2026-03-31 14:30:41 -07: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
2fedd2e043 Adopt esbuild for a few more extensions
- extension-editing
- terminal-suggest
- tunnel-forwarding
- php language features
2026-02-18 15:20:02 -08:00
Dmitriy Vasyura
fa6cfe12c6 Metered network connections support (#288919)
Includes public API, user setting, status bar icon and a new service to support metered network connections.
Updates code in various areas performing automated actions using network to delay/pause network operations while network connection is being metered.
2026-02-06 14:52:14 -08:00
Christof Marti
2fd6a33c04 Surface power API 2026-02-05 16:57:40 +01:00
Alex Ross
9519571a4a Skip flaky test " setTextDocumentLanguage for notebook cells" (#293072) 2026-02-05 11:04:16 +00:00
Matt Bierner
ee01088b74 Update roots 2026-01-30 13:12:58 -08:00
Matt Bierner
0d9a2ef2b0 Add explicit rootDirs 2026-01-30 11:07:53 -08:00
Alex Ross
f89c803449 Try once again to fix the element already registered bug (#290795)
Fixes microsoft/vscode-pull-request-github#8073
2026-01-27 18:11:33 +01:00
Sandeep Somavarapu
d4d37b83e0 Add proposed API support for agent sessions workspace (#290385)
* Add proposed API support for agent sessions workspace

* add access to agentSessionsWorkspace proposed api
2026-01-26 16:05:36 +00:00
Dmitriy Vasyura
aa19df565f Portable mode improvements and bug fixes (#287063)
Disabled protocol handlers and registry updates on Windows in portable mode.
Added API proposal to detect if VS Code is running in portable mode from extensions.
Skipped protocol redirect in GitHub authentication in portable mode.
2026-01-24 13:22:53 +01:00
Anthony Kim
acb22942b0 Remove winpty support (#289025)
* Bump node-pty to 1.2.0-beta.7

* Deprecate TerminalSettingId.WindowsEnableConpty setting

* Remove windowsEnableConpty instead of deprecating

* Remove WINPTY from ps.ts

* Remove winpty from appropriate comments

* Remove winpty from IProcessReadyWindowsPty

* Remove from classifier.json. TODO on resize for node-pty

* Try adding option to test

* Add reference to issue
2026-01-21 08:32:11 -08:00
Don Jayamanne
2fd8c70fa1 mcp: expose MCP server definitions to ext host (#288798)
* Expose MCP server definitions to ext host

* Fixes

* Update src/vs/workbench/api/common/extHostTypeConverters.ts

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

* Update src/vs/workbench/api/browser/mainThreadMcp.ts

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

* Address review comments

* address review comments

* Reuse McpServerDefinition.Serialized instead of custom DTOs (#289165)

* Initial plan

* Reuse McpServerDefinition.Serialized instead of custom DTO interfaces

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>

---------

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2026-01-20 14:45:55 -08:00
Dmitriy Vasyura
fa6c146385 Finalize quickInputButtonLocation API proposal 2026-01-07 17:35:45 +01:00
Tyler James Leonhardt
cbc91ee43b Revert "Finalize quickPickButtonLocation API proposal" (#285984) 2026-01-05 11:29:58 -08:00
Dmitriy Vasyura
d9835cfa08 Finalize quickInputButtonLocation API proposal 2025-12-18 19:36:56 -08:00
Dmitriy Vasyura
56555a8bf1 Finalize quickPickItemResource API proposal (#283877) 2025-12-16 19:11:02 +00:00
Johannes Rieken
d13c32e27f disable flakly test again https://github.com/microsoft/vscode/issues/254042 (#283836) 2025-12-16 15:45:42 +00:00
Alex Ross
950ca05d5c Reapply element already registered race condition fix (#283079)
Fixes microsoft/vscode-pull-request-github#8073
2025-12-12 18:01:41 +01:00
dependabot[bot]
7971753268 Bump node-forge from 1.3.1 to 1.3.2 in /extensions/vscode-api-tests (#279673)
Bumps [node-forge](https://github.com/digitalbazaar/forge) from 1.3.1 to 1.3.2.
- [Changelog](https://github.com/digitalbazaar/forge/blob/main/CHANGELOG.md)
- [Commits](https://github.com/digitalbazaar/forge/compare/v1.3.1...v1.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-08 18:40:24 +00:00
Johannes Rieken
5d52b31d8d understand why tests fails (#282002)
https://github.com/microsoft/vscode/issues/254042
2025-12-08 17:18:19 +00:00
Alex Ross
653d30ab18 Revert "Fix element already registered (#281000)" (#281278)
* Revert "Fix element already registered (#281000)"

This reverts commit ca3f2212d1.

* skip test
2025-12-04 09:43:55 -08:00
Alex Ross
472dee5115 Another fix for "element with id not registered" error (#281269)
Fixes microsoft/vscode-pull-request-github#8073
2025-12-04 16:49:41 +00:00
Alex Ross
ca3f2212d1 Fix element already registered (#281000)
Fixes microsoft/vscode-pull-request-github#8073
2025-12-03 09:59:37 -08:00
Don Jayamanne
2ad979732c Remove unwanted console.logs (#277374) 2025-11-14 11:37:45 +01:00
Matt Bierner
723aa849c9 Convert gulpfiles to modules
Makes a pass through our top level gulpfiles to convert them to modules
2025-11-11 15:28:50 -08:00
Daniel Imms
0f2bcf765a Merge branch 'main' into tyriar/274723_platform_terminal__api 2025-11-10 06:57:41 -08:00