Commit Graph

58 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
Raymond Zhao
1251d8b737 chore: bump native-watchdog (#287848)
* chore: bump native-watchdog

* Rename more instances

* chore: update Debian x64 dep list
2026-01-15 15:34:13 +09:00
Benjamin Pasero
fe665a91f6 watcher - update to latest version (#286484) 2026-01-09 07:07:37 +01:00
Benjamin Pasero
43b3987e74 debt - adopt @vscode/watcher with some newer fixes (#285247) 2025-12-29 03:57:05 -08:00
Daniel Imms
281f94f487 Include powershell and bash grammars in bundle
Fixes #272852
2025-10-23 08:58:55 -07:00
Alex Ross
7249efcfae Add tree-sitter for css (#244112)
* Add tree-sitter for css

* Hard code root scopes

* Add some temp logging for test

* Exclude css from module ignore

* Remove log lines
2025-03-20 13:45:47 +01:00
Robo
a032042791 build: remove broken @vscode/node-addon-api (#240631) 2025-02-13 20:56:46 +09:00
Alex Ross
e2a3691756 Use tree sitter for ini (#240534)
* Use tree sitter for ini
Part of #210475

* Include ini in tree sitter colorization tests

* Remove /r
2025-02-13 08:36:42 +01:00
Connor Peet
92e7dc6aae chore: include web bits for smoke tests (#231354)
try
2024-10-14 15:55:15 -07:00
Connor Peet
40206b2534 chore: simplify some moduleignore patterns (#231330) 2024-10-14 19:53:41 +02:00
Benjamin Pasero
b591f33513 🆙 jschardet@3.1.4 (#230197) 2024-10-01 08:19:15 +02:00
Benjamin Pasero
4c1716492a watcher - remove experimental next watcher (#229261) 2024-09-21 08:48:01 -07:00
Benjamin Pasero
819cf1cd22 watcher - allow to use latest version of @parcel/watcher behind experimental setting (#228200)
We are pulling this in from `@bpasero/watcher` as a temporary solutionto:
- fix a deadlock issue in upstream
- allow to switch back and forth between the old and the new version
2024-09-11 13:21:52 +02:00
Benjamin Pasero
d03aeaf1fb Can't open files (#226898) (#226996) 2024-08-28 20:50:13 +02:00
Daniel Imms
1ea3ff215e Don't ship non-arch binaries 2024-08-06 05:54:41 -07:00
Logan Ramos
cd93de1b0c Rename vsDeviceId (#213261) 2024-05-22 23:13:13 +02:00
Sandeep Somavarapu
378b4c969b use vsce-sign module from npm (#205511)
* update distro

* use vsce-sign module

* update distro

* update distro
2024-02-19 09:17:54 +01:00
Daniel Imms
1532b5aebd Add xterm scope to moore places 2023-11-02 06:34:09 -07:00
Tyler James Leonhardt
5134662139 Remove CredentialsService & keytar (#192224)
* Remove CredentialsService & keytar

ref https://github.com/microsoft/vscode/issues/115215
fixes https://github.com/microsoft/vscode/issues/143395

* compile

* remove imports

* rip the bandaid
2023-09-05 17:47:30 -07:00
Tyler James Leonhardt
1e0b12d1ca Remove vscode-encrypt from node.js side (#189252)
* Remove vscode-encrypt from node.js side

Now that we've had a version of the product that has done the migration logic, we no longer need vscode-encrypt on the node side.

This removes all references of vscode-encrypt from the node side. I will also remove it from the package.jsons in distro.

* remove machineId
2023-08-01 11:30:48 +10:00
Christof Marti
6ae441b56f Kerberos auth for proxies (#188130) 2023-07-19 20:11:00 +02:00
Raymond Zhao
13e7d80fcd Bump windows-process-tree (#184759)
Fixes https://github.com/microsoft/vscode/issues/179697
2023-06-12 11:36:56 -07:00
João Moreno
0f833f26f9 ignore SECURITY.md from vsda (#182780) 2023-05-17 19:00:49 +02:00
Raymond Zhao
22ed59eb3d Bump windows-process-tree with workaround for typings (#179649) 2023-04-11 10:05:56 -07:00
Raymond Zhao
07aec54e2e Bump spdlog (#179642) 2023-04-11 08:00:57 -07:00
Raymond Zhao
84ac780186 Revert "Bump windows-process-tree" (#179508)
Revert "Bump windows-process-tree (#179176)"

This reverts commit 15cb6b36f8.
2023-04-08 00:47:57 +01:00
Raymond Zhao
15cb6b36f8 Bump windows-process-tree (#179176)
* Bump windows-process-tree

* Fix compile error

* Add explanation to source

* Add that the types package has been deprecated
2023-04-05 20:51:26 +02:00
Raymond Zhao
a1694a8628 Bump windows-mutex (#179196) 2023-04-04 23:36:05 +02:00
Robo
d317fbf297 chore: revert @vscode/spdlog bump (#179103)
* Revert "chore: update spdlog@0.13.9 (#179087)"

This reverts commit 9eba21c20f.

* Revert "Bump spdlog (#179035)"

This reverts commit 4cc7f76f60.
2023-04-04 10:49:54 +02:00
Raymond Zhao
90089562cc Bump proxy-agent (#179033) 2023-04-03 15:23:31 -07:00
Raymond Zhao
4cc7f76f60 Bump spdlog (#179035) 2023-04-03 11:18:47 -07:00
João Moreno
5f9bbf37c1 Revert "adopt new module locations (#177472)"
This reverts commit 5b6cd9c3c7.
2023-03-17 18:55:13 +01:00
João Moreno
5b6cd9c3c7 adopt new module locations (#177472)
Co-authored-by: Martin Aeschlimann <martinae@microsoft.com>
2023-03-17 15:34:17 +01:00
João Moreno
07a7d71087 Bump to @vscode/policy-watcher (#174354)
* use latest @vscode/policy-watcher

* fix compile

* ooops

* lock new version
2023-02-14 16:53:34 +01:00
João Moreno
c7930ca55d Revert "bump @vscode/policy-watcher (#174063)" (#174072)
This reverts commit 47e3135bda.

Revert "move to @vscode/policy-watcher (#173950)"

This reverts commit a1e73c96a4.
2023-02-10 16:37:50 +01:00
João Moreno
a1e73c96a4 move to @vscode/policy-watcher (#173950) 2023-02-09 07:12:42 -08:00
Robo
fdb2befac5 chore: update node-pty@0.11.0-beta27 (#171583) 2023-01-19 11:12:46 +01:00
Matt Bierner
6e5b663e99 Make sure lib.d.ts is included in build (#168501)
Fixes #168420
2022-12-08 11:36:42 -08:00
Matt Bierner
afd71d8f10 Be more selective about which typescript d.ts files we include (#167477)
Be more selective about which d.ts files we include
2022-11-28 16:27:03 -08:00
Matt Bierner
f98ca02f59 Use moduleignore to try excluding unused ts files (#166654)
Use moduleignore to exclude unused ts files

Fixes #166652
2022-11-17 15:53:52 -08:00
Sandeep Somavarapu
c1ac223c69 fix node-vsce-sign (#164253)
* update distro

* add vsce-sign to asar

* filter node-vsce-sign

* update distro
2022-10-21 08:25:36 -07:00
João Moreno
9ec34a5b60 Revert "stop shipping build-only dependencies (#162172)" (#162254)
This reverts commit 582aa29f85.
2022-09-28 13:50:35 -07:00
João Moreno
582aa29f85 stop shipping build-only dependencies (#162172) 2022-09-28 06:20:58 -07:00
Logan Ramos
5e26d5f9b3 Stop removing app insights in the meantime (#152413) 2022-06-16 18:59:10 -07:00
Logan Ramos
7025c6e71c Include more of the shims folder in attempt to fix build (#152398) 2022-06-16 23:11:33 +00:00
Logan Ramos
48809de3f9 Update module ignores to include AI shims required by 1DS (#152367) 2022-06-16 18:18:00 +00:00
Joao Moreno
e2029b6cbe cleanup vscode-policy-watcher 2022-05-18 11:15:18 +02:00
Martin Aeschlimann
db9e8fba63 remove unecessary files in build 2022-02-18 20:38:55 +01:00
Martin Aeschlimann
172105554f avoid app-insights files in the build. For #143377 2022-02-18 20:38:55 +01:00
Joao Moreno
ca19f126d6 cleanup @vscode/windows-registry 2022-01-25 14:40:22 +01:00