Commit Graph

170 Commits

Author SHA1 Message Date
dileepyavan
8a3bfca4c6 Reverting sandbox manager changes in main. (#302625)
* changes

* fixing merge issue
2026-03-18 01:51:54 +00:00
Connor Peet
7b40408a9b fix e2e tests 2026-03-17 12:00:26 -07:00
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
dileepyavan
0cb8d31bc8 [Terminal_sandbox] Notify when user consent is needed for permissions in sandbox. (#301413)
* Add experiment mode to terminal sandbox

* Updating regex to extract file name

* migrating to sandbox manager from srt

* updating the regex for picking folder paths

* updating the regex for picking folder paths

* correcting the code layers

* Potential fix for pull request finding

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

* refactor

* refactor

* changes

* changes

* refactor

* refactor

* fixing tests

* fixing tests

* fixing tests

* test cases fix

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-13 14:22:18 -07:00
Benjamin Pasero
e1f87601f6 wip - sessions title 2026-03-11 16:35:38 +01:00
Matt Bierner
7df46143a1 Experiment with switching markdown extension to use native privates
Let's try this out with one extension to start
2026-03-10 23:13:16 -07:00
Osvaldo Ortega
b844d33510 Fixes 2026-03-10 17:18:41 -07:00
Osvaldo Ortega
63b43291ff Merge branch 'main' of https://github.com/microsoft/vscode into copilot-worktree-2026-02-27T00-36-54 2026-03-10 14:57:02 -07:00
Osvaldo Ortega
6012003733 Move TS test files to src/vs/sessions/test/
The test/e2e/ directory was too deep for TypeScript to resolve imports
back to src/vs/. Move to test/ (one level up) where imports work.

E2E runner scripts (.cjs) and scenarios stay in test/e2e/.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 14:03:51 -08:00
Osvaldo Ortega
02d5d0ed10 Move test files to src/vs/sessions/test/e2e/
Keeps all E2E test code (mocks, runners, scenarios, extensions) in one
place, separate from production Sessions code. Updates import paths,
server path, and ESLint config.

Note: ESLint import-patterns warnings remain because the relative
imports from test/e2e/ depth don't match the restriction glob syntax.
This is cosmetic — the imports are valid TypeScript.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 13:58:54 -08:00
Osvaldo Ortega
4d61c82ede Add Approach 2: Service overrides for E2E mock testing
New files:
- web.test.ts: TestSessionsBrowserMain with MockChatEntitlementService
- web.test.factory.ts: Factory using TestSessionsBrowserMain
- sessions.web.test.internal.ts: Test entry point

Server uses test entry point when --mock, which injects a mock
IChatEntitlementService returning ChatEntitlement.Free with
installed=true, so Sessions thinks the user is signed in.

Also adds ESLint import patterns for sessions web entry points.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-03-05 11:57:48 -08:00
Sandeep Somavarapu
5ee6f4f532 fix reading configuration from workspace folders (#299302)
* fix reading configuration from workspace folders

* feedback
2026-03-05 07:59:20 +01:00
Matt Bierner
a453d99821 Port git extension to use esbuild
Fixes #296355
2026-02-26 14:10:15 -08:00
Sandeep Somavarapu
cac4044503 - fix listening to active session (#298012)
* - fix listening to active session
- new empty workbench workspace service for sessions
- add active workbench folder to workspace

* fix tests

* feedback

* fix compilation

* fix compilation
2026-02-26 16:04:12 +00:00
Matt Bierner
16c4d66606 Update eslint.config.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-19 09:20:12 -08:00
Matt Bierner
2d698cf054 Disallow dynamic require/import in extensions
Follow up on https://github.com/microsoft/vscode/pull/296220

Let's make sure more code doesn't introduce this pattern without some thought
2026-02-19 00:00:24 -08:00
Benjamin Pasero
b1009c98bb Sessions exploration (#294912) 2026-02-17 14:14:39 +00:00
Johannes Rieken
4f5d8f3946 Remove code-no-native-private ESLint rule (#295535) 2026-02-16 10:03:47 +01:00
Johannes Rieken
970fb634fc fix declare const enum not inlined by esbuild, fixes #295046 (#295149) 2026-02-13 12:09:46 +00:00
Benjamin Pasero
855722ab9c Startup perf regression due to top level import of http (fix #294857) (#294894)
* Startup perf regression due to top level import of http (fix #294857)

* Startup perf regression due to top level import of `http` (fix #294857)

* .
2026-02-12 14:58:23 +01:00
Matt Bierner
70e58babb6 Remove file that doesn't exist 2026-02-10 14:09:07 -08:00
Matt Bierner
d81b46203c Fix globs 2026-02-10 14:08:14 -08:00
Matt Bierner
f5827dab39 Adopt esbuild for bundling more builtin extensions
Follow up on #294208
2026-02-10 12:39:41 -08:00
Matt Bierner
d434a65945 Use esbuild to pack the markdown extension for desktop and web (#294208)
* Try using esbuild to bundle our built-in extensions

Test switching to esbuild instead of webpack to bundle our buildin extensions. Setup so we can do this incrementally and starting with the markdown extension as a test

* Fix build ext media

* Fix .ts script name check

* Update comment

* Use ts for all scripts
2026-02-10 20:32:40 +00:00
Matt Bierner
692b629077 Make chatHooks proposal self contained 2026-02-09 09:55:11 -08:00
Matt Bierner
40df840a80 Fix build error when using tsgo
We added a dependency between api proposals. Looks like tsgo is more strict about not picking this up automatically so we need to make sure there is an import so the dependency is picked up
2026-02-09 09:18:10 -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
Megan Rogge
ce2bb21b71 rm any from task files (#293508)
task part of #274723
2026-02-06 12:01:41 -08:00
Christof Marti
2fd6a33c04 Surface power API 2026-02-05 16:57:40 +01:00
Megan Rogge
2a55ee3d69 replace in checks with Object.hasOwn (#292956)
replace in checks with Object.hasOwn
2026-02-04 23:16:21 +00:00
Rob Lourens
1c41206f8a Subagents render as a single line, similar to 'collapsed' thinking mode (#290059)
* Subagents render as a single line, similar to 'collapsed' thinking mode

* Remove now-unused eslint disable directives
2026-01-23 18:14:18 -08: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
Matt Bierner
a7de96819c Reapply timing and chat session changes
This reverts commit 17523c000e

Skips the api version bump this time since it's not needed

Breaking API change since `created` is now required but won't actually break at runtime
2026-01-14 13:04:18 -08:00
Alex Ross
17523c000e Revert recent merges affecting chat session functionality (#287734)
* Revert "Merge pull request #287668 from mjbvz/dev/mjbvz/eventual-sparrow"

This reverts commit 81f7af4b9f, reversing
changes made to 85a14f966c.

* Revert "Merge pull request #286642 from microsoft/dev/mjbvz/chat-session-item-controller"

This reverts commit b39ecc3960, reversing
changes made to 45aced5935.
2026-01-14 10:18:42 +00:00
Matt Bierner
b39ecc3960 Merge pull request #286642 from microsoft/dev/mjbvz/chat-session-item-controller
Explore a controller based chat session item API
2026-01-13 15:35:48 -08:00
Dmitriy Vasyura
b1bf400da2 Initial revision of automated release sanity checks. (#280857) 2026-01-09 17:07:18 +01:00
Benjamin Pasero
fe665a91f6 watcher - update to latest version (#286484) 2026-01-09 07:07:37 +01:00
Matt Bierner
3f197a6583 Initial sketch of a controller based chat session item API
For #276243

Explores moving the chat session item api to use a controller instead of a provider
2026-01-08 16:23:58 -08:00
Osvaldo Ortega
e166b7b679 Revert "Revert "debt - remove AMD support of VSCode for web"" (#286423)
Revert "Revert "debt - remove AMD support of VSCode for web" (#286421)"

This reverts commit 84ce6e1a98.
2026-01-07 13:02:55 -08:00
Osvaldo Ortega
84ce6e1a98 Revert "debt - remove AMD support of VSCode for web" (#286421)
Revert "debt - remove AMD support of VSCode for web (#285230)"

This reverts commit 74c4ecddf7.
2026-01-07 19:30:20 +00:00
Rob Lourens
99d8a2706e Reorganize workbench/contrib/chat (#285467)
* Move some tools files

* chat/accessibility

* Fix this

* Move model files into model/

* Move tool invocation into model/

* Move builtinTools under tools/

* Add common/ui/ folder

* attachments/ and participants/

* browser/widget/ folder

* attachments/ and tools/

* widgetHosts/

* widget/modelPcker/ and context/

* Doc and more organizing

* widget/input/

* widget/chatContentParts/

* More cleanup in common/

* Tweak docs, move a file

* Break up contrib/ folder

* Fix test/ files
2025-12-31 13:02:33 -08:00
Benjamin Pasero
43b3987e74 debt - adopt @vscode/watcher with some newer fixes (#285247) 2025-12-29 03:57:05 -08:00
Benjamin Pasero
74c4ecddf7 debt - remove AMD support of VSCode for web (#285230) 2025-12-28 20:12:52 +01:00
Rob Lourens
e90ece8f4d Some lint fixes (#284809) 2025-12-23 04:00:54 +00:00
Benjamin Pasero
e6aeab6051 debt - removal of old agent sessions views and co (#282712) 2025-12-11 14:02:11 +00:00
Benjamin Pasero
62aaaa7925 debt - opt all of contrib/chat into no-explicit any (#274723) (#280329) 2025-12-01 10:20:46 -05:00
Benjamin Pasero
99d307278f Reduce use of explicit any type (#274723) 2025-11-30 08:37:08 +01:00
Benjamin Pasero
a2ad562e64 Reduce use of explicit any type (#274723) (#279751) 2025-11-27 08:56:44 +00:00
Dmitriy Vasyura
f2f21a56ea Remove Map/Set eslint rule 2025-11-25 11:00:09 -08:00
Dmitriy Vasyura
535f6eaa0f Merge branch 'main' into dev/dmitriv/eslint-map-delete 2025-11-21 11:34:34 -08:00