Commit Graph

185 Commits

Author SHA1 Message Date
Rob Lourens
98f15b55ea Implement agentHost process (#296627)
* agent host init

* Agent host: Copilot SDK integration with chat UI

* Agent host: direct MessagePort, logging, SDK wrapper, env fix

* Refactoring and cleanup

* Copilot-authored message: Agent-host tool rendering, protocol, and session fixes

Tool invocation rendering:
- Emit tool_start/tool_complete as ChatToolInvocation (not progressMessage)
- Shell tools (bash/powershell) render as terminal command blocks with
  IChatTerminalToolInvocationData, output, and exit codes
- Non-shell tools render via invocationMessage/pastTenseMessage (markdown)
- Filter out report_intent (hidden internal tool)

Agent-agnostic protocol:
- IPC events carry display-ready fields (displayName, invocationMessage,
  pastTenseMessage, toolInput, toolOutput, toolKind, language)
- All Copilot CLI-specific logic in copilotToolDisplay.ts with typed
  interfaces for known tools (CopilotToolName enum, parameter types)
- Renderer never references specific SDK tool names

Session fixes:
- Resumed sessions show tool invocations in history (getSessionMessages
  now returns tool events alongside messages)
- Fixed 'already has a pending request' on resumed sessions by
  conditionally providing interruptActiveResponseCallback
- Fixed event filtering for resumed sessions (sessionId override in
  _trackSession)

Documentation:
- Split parity.md into design.md (decisions) and backlog.md (tasks)
- Updated architecture.md, sessions.md with cross-references
- Added maintenance notes to all docs

* Copilot-authored message: Model picker, session class, DI and test cleanup

* Cleanups

* stuff

* add diagram

* Add claude agent

* Clean up

* Copy some build script changes from #295817

* Simplify

* Update docs

* Register agent-host via chatSessions contribution API, reduce peripheral diff

* Cleanup

* Don't ship stuff in stable

* Dynamic agent discovery via listAgents() IPC

Replace hardcoded per-provider contributions with a single
AgentHostContribution that discovers available agents from the
agent host process at startup. Each IAgent backend now exposes
an IAgentDescriptor with display metadata and auth requirements.

- Add IAgentDescriptor interface and listAgents() to IPC contract
- CopilotAgent/ClaudeAgent return descriptors via getDescriptor()
- Single AgentHostContribution discovers + registers dynamically
- Remove agentHostConstants.ts (no more hardcoded session types)
- AgentHostSessionListController/LMProvider take params instead
- Rename AgentSessionProviders.AgentHost -> AgentHostCopilot
- Update architecture.md, sessions.md, backlog.md

(Written by Copilot)

* Fix review findings: proxy, disposal, filtering, tests

- Add listAgents() forwarding to AgentHostServiceClient
- Guard async discovery against disposal race
- Add provider field to IAgentModelInfo for per-provider filtering
- Filter models and sessions by provider in LM provider and list
  controller
- Update tests for new dynamic API and agent-host-copilot scheme

(Written by Copilot)

* Use DI for AgentHostLanguageModelProvider

(Written by Copilot)

* Strip @img/sharp native binaries from builds

sharp is a transitive dependency of the Claude Agent SDK used for
image processing. Its native .node binaries cause dpkg-shlibdeps
errors during Debian packaging due to $ORIGIN RPATH references.
Strip all @img/sharp-* platform packages since the agent host
doesn't need image processing at runtime.

(Written by Copilot)

* Strip Claude SDK vendored ripgrep binaries

The Claude Agent SDK bundles ripgrep binaries for all platforms
under vendor/ripgrep/. Wrong-architecture binaries cause macOS
Mach-O verification to fail. Strip them entirely via .moduleignore
(VS Code has its own ripgrep) and add to verify-macho skip list.

(Written by Copilot)

* Add tests for AgentSession, AgentService dispatcher, and workbench agent host components

(Written by Copilot)

* Add trace logging, IPC output channel, tool permissions, and attachment context

- Add Agent Host IPC output channel (only registered at trace log level) that
  logs all IPC method calls, results, and progress events with full JSON payloads
- Add trace-level logging in AgentService dispatcher for all method calls
- Add trace-level logging in session handler for all progress events and session
  resolution
- Wire up onPermissionRequest handler on CopilotClient.createSession and
  resumeSession to auto-approve tool permission requests
- Add IAgentAttachment type to IPC contract and thread attachments from chat
  variables (file, directory, selection) through sendMessage to the Copilot SDK

(Written by Copilot)

* Add tests for attachment context conversion and threading

(Written by Copilot)

* Add gap analysis docs for Copilot and Claude SDK implementations

(Written by Copilot)

* Sanitize env vars for Copilot CLI subprocess

Strip VSCODE_*, ELECTRON_* (except ELECTRON_RUN_AS_NODE), NODE_OPTIONS, and
other debug-related env vars that can interfere with the Node.js process the
SDK spawns. Matches the env sanitization from the extension implementation.
Also set useStdio and autoStart for proper CLI communication.

(Written by Copilot)

* Add error, usage, and title_changed event types to IPC contract

Add IAgentErrorEvent, IAgentUsageEvent, and IAgentTitleChangedEvent to the
progress event union. Wire up session.error and assistant.usage events from
the Copilot SDK to fire as IPC events instead of only logging. Handle error
events in the renderer session handler by rendering the error message. Usage
and title_changed events are logged at trace level.

(Written by Copilot)

* Add abortSession IPC method for proper cancellation

Add abortSession(session) to the IPC contract, implemented across AgentService,
CopilotAgent (calls session.abort()), ClaudeAgent (no-op, uses AbortController),
and the renderer proxy. Wire up cancellation in the session handler to call
abortSession before finishing, so the SDK actually stops processing.

(Written by Copilot)

* Address reviewer feedback: error finishes request, Claude abort, tests

- Error events now call finish() so the request doesn't hang if the SDK
  doesn't send idle after an error
- ClaudeAgent.abortSession calls ClaudeSession.abort() which signals the
  AbortController and creates a new one for future turns
- Add test: cancellation calls abortSession on the agent host service
- Add test: error event renders message and finishes the request
- Remove stale TODO in interruptActiveResponseCallback
- Use timeout() helper instead of raw setTimeout in test
- Update gap docs to reflect completed work

(Written by Copilot)

* Add permission request IPC round-trip (Written by Copilot)

* Remove Claude agent from agent-host process

Strip the Claude Agent SDK integration from the agent-host utility process
to focus on the Copilot SDK path.

- Delete src/vs/platform/agent/node/claude/ (claudeAgent, claudeSession, claudeToolDisplay)
- Remove @anthropic-ai/claude-agent-sdk from package.json
- Remove AgentHostClaude enum member and all switch cases
- Remove Claude command registration in electron-browser chat.contribution
- Clean up build scripts (.moduleignore, verify-macho, gulpfile.vscode)
- Narrow AgentProvider type to just 'copilot'
- Update tests and documentation

(Written by Copilot)

* Wire up permission confirmation UI with ChatToolInvocation (Written by Copilot)

* Fix reviewer feedback: safe permission serialization, deny on abort/dispose (Written by Copilot)

* Forward reasoning events as thinking blocks (Written by Copilot)

* Pass workspace folder as workingDirectory to Copilot SDK (Written by Copilot)

* Store and pass workingDirectory on session resume, update gap docs (Written by Copilot)

* Fix permission rendering, session-scoped permissions, and test gaps (Written by Copilot)

* Auto-approve read permissions inside workspace folder (Written by Copilot)

* Move read auto-approve into CopilotAgent where permission policy belongs (Written by Copilot)

* Update gap docs (Written by Copilot)

* Use log language for IPC output channel, add trace prefix (Written by Copilot)

* Add tool rendering gaps to docs (Written by Copilot)

* Stringify URIs in IPC output channel for readability (Written by Copilot)

* Fix IPC output channel: use log languageId with non-log channel for proper append + syntax highlighting (Written by Copilot)

* Fix build errors: add URI import, fix test mock types (Written by Copilot)

* Don't localize agent host provider strings (Written by Copilot)

* Remove claude-agent-sdk from eslint allowed imports (Written by Copilot)

* fix test

* initial thoughts

* Rename folder to agentHost

* Fix paths

* Fixes

* Fixes for copilot

* Fix moduleignore

* first working protocol version

align more closely with protocol

json rpc and some gaps

* cleanup

* Fix copilot pty.node packaging

* Fix test

* prebuild packaging

* Agenthost server fixes

* Update monaco.d.ts

* Update docs

* Fixes

* Build fix

* Fix build issues

* reduce duplication in side effecting code

* fix model switching not working

* reduce mock duplication

* Build fixes

* Copy vscode's node.pty

* And ripgrep

* And thsi

* Ripgrep goes to non-SDK

* Skip copy for stable build

* Remove outdated script

* Build fixes for asar

* fix

* Add some logging

* Fix for windows

* Fix

* Logs

* build: add glob diagnostic for copyCopilotNativeDeps

* build: check both node_modules/ and .asar.unpacked/ for source binaries

* Fix

* Remove excalidraw

---------

Co-authored-by: Connor Peet <connor@peet.io>
Co-authored-by: Connor Peet <copeet@microsoft.com>
2026-03-16 15:33:31 -07:00
Henning Dieterichs
96baba2cc4 feat: update component explorer dependencies and add new test fixtures
- Updated @vscode/component-explorer to version 0.1.1-16 and @vscode/component-explorer-cli to version 0.1.1-12 in package.json and package-lock.json.
- Added new test fixtures for chat question carousel, code action list, find widget, inline completions extras, rename widget, and suggest widget.
- Implemented rendering logic for new fixtures to enhance testing capabilities for various components.
2026-02-26 15:30:23 +01:00
Benjamin Pasero
4ae85be683 separate user data dir (#297621)
* eng - add launch config for sessions

* separate user data dir
2026-02-25 08:03:30 +00:00
Henning Dieterichs
5c4204e60d updates component explorer 2026-02-23 22:44:44 +01:00
Henning Dieterichs
bce538863f adds component explorer (#294075)
* adds component explorer

* Removes log
2026-02-11 12:06:16 +01:00
Robo
d0e516655a fix: rename product executable on macOS (#291948)
* fix: rename product executable name on macOS

* chore: update test/automation/src/electron.ts

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

* chore: update test/automation/src/electron.ts

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

* chore: rename in additional places

* chore: rename in code-perf.js

* chore: create symlink for backwards compatibility

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-03 14:50:21 -08:00
Henning Dieterichs
2b1a433829 Fixes vite launch config env variables (#278753) 2025-11-21 14:12:28 +01:00
Henning Dieterichs
a335d51f66 Adds hot reload launch config (#277123)
* Adds hot reload launch config

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
2025-11-21 11:18:47 +01:00
Henning Dieterichs
b6b78218fe adds monaco editor playground launch config 2025-11-11 18:32:36 +01:00
Henning Dieterichs
c444a6c8f3 Fixes https://github.com/microsoft/vscode/issues/261680 2025-08-15 11:18:13 +02:00
Connor Peet
99b897a32a eng: adopt killBehavior polite (#251159)
* tools: respect chat.editor.wordWrap setting in tool confirms

Closes https://github.com/microsoft/vscode-copilot/issues/17373

* eng: adopt killBehavior polite

Refs https://github.com/microsoft/vscode-js-debug/pull/2238
Closes https://github.com/microsoft/vscode/issues/244111
2025-06-10 16:13:04 -07:00
Henning Dieterichs
c790f5e777 Adds VSCODE_DEV_DEBUG to turn on extension-based observable logging (#242695)
* Adds VSCODE_DEV_DEBUG to turn on extension-based observable logging

* Fixes CI

* Fixes CI
2025-03-05 18:43:12 +00:00
Henning Dieterichs
28448cedcf Removes debugger scripts, as they don't work with ESM anymore. (#239445) 2025-02-03 03:17:36 +01:00
Alex Ross
e6f2cc2f0a Add an easy way to run performance tests for tree-sitter (#233072)
* Add an easy way to run performance tests for tree-sitter
Part os #210475

* Compile build folder
2024-11-05 15:35:58 +01:00
Henning Dieterichs
e1430e4328 Sets up hot reloading of css and code (requires vscode-diagnostic-tools extension to be installed) 2023-09-01 14:35:42 +02:00
Connor Peet
6004a9f716 debug: put user data dir in home dir, update versions of things (#189855) 2023-08-07 19:46:38 +01:00
Connor Peet
2d2797bba6 debug: let js-debug store the oss profile in workspace storage (default behavior) (#189828)
Fixes #177664
2023-08-07 16:24:07 +01:00
Johannes Rieken
26a1feb1bd joh/envious jay (#185839)
* remove bogus launch-config, fyi @connor4312

* disable API test extension when running from launch config
2023-06-22 10:05:47 +02:00
Connor Peet
a0fce779af chore: bump js-debug-companion (#185589)
For livepreview
2023-06-19 18:36:39 +02:00
Matt Bierner
cc244e095a Fix outfiles for VS Code API tests (#182228)
This lets you correctly hit breakpoints in the API tests
2023-05-11 14:33:29 -07:00
Tyler James Leonhardt
fd23d86b04 Allow debugging the issue reporter by removing uri filter (#181429)
The issue reporter has a different html file.
2023-05-03 19:20:37 +02:00
Henning Dieterichs
c9c8e53032 Replaces http-server with playground-server (#179876) 2023-04-13 07:39:35 -07:00
Robo
e5f61433b5 chore: update to Electron 22 (#177600)
* Revert "chore: revert to Electron 19 (#175851)"

This reverts commit 3a11b47eee.

* chore: bump electron@22.3.3

* build: use custom version for V8 sandbox

* chore: update electron@22.4.1

* chore: enable forceAllocationsToV8Sandbox for extension host

* chore: bump electron@22.4.2

* chore: bump electron@22.4.3

* sandbox - cleanup from electron 22 update (#178919)

* Revert "chore: revert to Electron 19 (#175851)"

This reverts commit 3a11b47eee.

* chore: bump electron@22.3.3

* build: use custom version for V8 sandbox

* chore: update electron@22.4.1

* chore: enable forceAllocationsToV8Sandbox for extension host

* chore: bump electron@22.4.2

* chore: bump electron@22.4.3

* temp: update distro

* sandbox - cleanup from electron 22 update

* missing comile

* more changes

* fix build

* restore

* 💄

* compile

---------

Co-authored-by: deepak1556 <hop2deep@gmail.com>

---------

Co-authored-by: Benjamin Pasero <benjamin.pasero@microsoft.com>
2023-04-03 09:09:31 +02:00
Henning Dieterichs
f4b345578d Adds monaco editor playground launch config & http server 2023-02-10 19:18:47 +01:00
Connor Peet
314d7b6c47 debug: allow setting breakpoints in plain .js files (#168921)
* debug: allow setting breakpoints in plain .js files

Fixes #159684

* fixup! don't change sourceURLs in build
2023-01-06 09:22:46 +01:00
Connor Peet
fad3a77833 debug: remove timeout connecting to renderer (#162899)
Fixes #159835
2022-10-06 16:02:09 -07:00
Sandeep Somavarapu
82ac904296 add run code web launches (#162364) 2022-09-29 17:45:27 +02:00
Benjamin Pasero
9db57e76e9 Build: bundle / concat entry points (#161161)
* perf - concatenate windows main files

* Revert "Revert "Use `esbuild` to bundle some CommonJS main files (#160957)" (#161118)"

This reverts commit 84c46b71a5.

* build - exclude server main files

* build - make concat a task that runs like the others

* some renames

* Avoid overwriting the nodejs closure require

* Revert "build - exclude server main files"

This reverts commit 736516624e.

Co-authored-by: Alex Dima <alexdima@microsoft.com>
2022-09-21 00:38:44 -07:00
Connor Peet
8c254bbf3e inspect-brk main process with renderer process (#159695)
Debugging the main process is fairly lightweight, so let's just always do it. Also, have more appropriate launch config names

 Fixes #159684
2022-08-31 19:13:39 +02:00
Sandeep Somavarapu
6ec6d9d94d Fix #158219 (#159289) 2022-08-26 14:05:37 +02:00
Rob Lourens
5a94444624 Remove pwa- from launch.json (#158234) 2022-08-16 05:16:35 +01:00
Matt Bierner
bbe7b54cf4 Remove custom editor tests (#152777)
These tests are not actively being run or maintained. Removing them for now
2022-06-21 15:37:19 -04:00
Martin Aeschlimann
c46555d9c8 Tests for configuration editing completion providers (#151953)
tests for configuration editing completion providers
2022-06-14 09:08:27 +02:00
Connor Peet
21e6c2aac0 debug: enable crash reporter when running debugging (#151430) 2022-06-08 11:11:13 +02:00
Babak K. Shandiz
7fc55261aa Ask user to select PR templates when forking a repository (#143733)
* Add getPullRequestTemplates method to discover templates

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Add method to quick pick for PR templates

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Handle possible PR templates

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Remove unnecessary return value assignment

Co-authored-by: João Moreno <mail@joaomoreno.com>

* Change comparison operands' order

Co-authored-by: João Moreno <mail@joaomoreno.com>

* Remove sorting template URIs in pickPullRequestTemplate

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Sort template URIs before showing quick-pick list

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Rename getPullRequestTemplates method to findPullRequestTemplates

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Find Github PR templates in-parallel using readdir/stat

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Export method for visibitliy in tests

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Add tests for Github PR template detection

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Add launcher configration to run Github tests

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* 💄

* Replace stat with readDirectory for OS native case sensitivity

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Delete some files to avoid duplicate names on case insensitive envs

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

* Exclude deleted files from test case expected result

Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>

Co-authored-by: João Moreno <mail@joaomoreno.com>
Co-authored-by: João Moreno <joao.moreno@microsoft.com>
2022-04-01 07:07:33 -07:00
Rob Lourens
f3153f1466 Always show mouseover markdown fold buttons for a focused cell 2022-02-10 11:37:32 -08:00
Rob Lourens
2be84d7df0 Hide focus indicator while dragging cell 2022-02-10 10:50:19 -08:00
Benjamin Pasero
13461f8c61 Web: change yarn web to run with our server instead of playground (#139725)
* web - first cut `yarn web` via our server

* properly pipe output

* web - remove traces of web playground

* web - remember last opened workspace for convinience

* use vscode-test-web for server less, clean up web commands

* fix comment

* fix `yarn web`

* rename to code-server

* open system browser

* code-server script: use minimist

* test resolver: use ./scripts/code-server

* integartion tests: fix code-server command name

Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
2022-01-20 13:48:08 +01:00
deepak1556
a9a598351e chore: bump electron@13.5.1
Fixes https://github.com/microsoft/vscode/issues/134244
Fixes https://github.com/microsoft/vscode/issues/122225
2021-10-02 00:37:51 +09:00
Daniel Imms
b5d1c0b987 Setup pty host debug target 2021-09-20 15:26:31 -07:00
Connor Peet
b5944ec59b include flags to work around electron issues 2021-08-30 09:50:24 -07:00
Connor Peet
8797cfe27e debug: use simple port attachment for launching main porcess
Fixes #129230
2021-08-05 10:54:15 -07:00
Connor Peet
9126e31644 debug: remove committed trace flags in js-debug debug 2021-07-23 16:45:20 -07:00
Connor Peet
581ff12c39 testing: improve test children API
This changeset results from the discussion in and fixes #126987.
Migration for these changes should take about 15-20 minutes.

- `createTestItem` no longer takes a parent. Instead, it creates a free-
  floating test item, which can be added as a child of a parent.
- The `TestItem.children` is now a `TestItemCollection`, a set-like
  interface that also allows replacing items (intelligently diffing
	them internally) wholesale. This removes the need for the "generation
	counter" used in samples previously.
- There is no longer a `root` on the test controller, but instead an
  `items` property which is the same `TestItemCollection`
- The `tests` in the `TestRunRequest` has been replaced with an `include`
  property. If undefined, the extension should run all tests. (Since
	there is no longer a root to reference).

Here's some example migrations:

- 3fad3d66c1
- 3aff746316
2021-07-14 18:12:59 -07:00
Connor Peet
fd14f3ebc0 debug: raise the extension host timeout
Fixes 126826
2021-07-09 12:56:02 -07:00
Connor Peet
126218be87 main: add a lockfile, and set the user data dir while debugging
See https://github.com/microsoft/vscode/issues/127861#issuecomment-877417451
2021-07-09 12:56:02 -07:00
Rob Lourens
526253bc34 Remove unneeded vscode-notebook-tests references
Fix #126384
2021-06-17 20:51:13 -07:00
Benjamin Pasero
270002e3b8 fix emmet test integration path 2021-06-15 15:40:24 +02:00
Connor Peet
4eee5c6ee5 testing: fix test wrapper not including ranges and not dealing with sync discovered root 2021-04-21 11:04:04 -07:00
Johannes Rieken
5f9f03e822 disable extensions when debugging API tests 2021-02-12 19:08:34 +01:00