Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
158 commits
Select commit Hold shift + click to select a range
4ff4a6a
agent host init
roblourens Feb 14, 2026
2b4db86
Agent host: Copilot SDK integration with chat UI
roblourens Feb 14, 2026
ff2a65c
Agent host: direct MessagePort, logging, SDK wrapper, env fix
roblourens Feb 14, 2026
01ce981
Refactoring and cleanup
roblourens Feb 15, 2026
4856fc2
Copilot-authored message: Agent-host tool rendering, protocol, and se…
roblourens Feb 15, 2026
832b373
Copilot-authored message: Model picker, session class, DI and test cl…
roblourens Feb 16, 2026
9f7664b
Cleanups
roblourens Feb 16, 2026
477b2f2
stuff
roblourens Feb 17, 2026
950e410
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Feb 20, 2026
8cf494e
add diagram
roblourens Feb 21, 2026
d2ea3c3
Copilot-authored message: Merge origin/main into roblou/agent-host
roblourens Feb 26, 2026
026fa0d
Add claude agent
roblourens Feb 27, 2026
7808fec
Clean up
roblourens Mar 3, 2026
7c7a098
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 3, 2026
4851e61
Copy some build script changes from #295817
roblourens Mar 3, 2026
72ccdd4
Simplify
roblourens Mar 3, 2026
e60e8cf
Update docs
roblourens Mar 3, 2026
e7256bf
Register agent-host via chatSessions contribution API, reduce periphe…
roblourens Mar 3, 2026
8deb082
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 3, 2026
3c4a05a
Cleanup
roblourens Mar 3, 2026
7d68783
Don't ship stuff in stable
roblourens Mar 4, 2026
21025d3
Dynamic agent discovery via listAgents() IPC
roblourens Mar 4, 2026
3e99314
Fix review findings: proxy, disposal, filtering, tests
roblourens Mar 4, 2026
5df6ee9
Use DI for AgentHostLanguageModelProvider
roblourens Mar 4, 2026
2bbc545
Strip @img/sharp native binaries from builds
roblourens Mar 4, 2026
29569f3
Strip Claude SDK vendored ripgrep binaries
roblourens Mar 4, 2026
be3707f
Add tests for AgentSession, AgentService dispatcher, and workbench ag…
roblourens Mar 4, 2026
9a3191f
Add trace logging, IPC output channel, tool permissions, and attachme…
roblourens Mar 4, 2026
9e207b1
Add tests for attachment context conversion and threading
roblourens Mar 4, 2026
8d13f2d
Add gap analysis docs for Copilot and Claude SDK implementations
roblourens Mar 4, 2026
f45d897
Sanitize env vars for Copilot CLI subprocess
roblourens Mar 4, 2026
794e939
Add error, usage, and title_changed event types to IPC contract
roblourens Mar 4, 2026
e30912d
Add abortSession IPC method for proper cancellation
roblourens Mar 4, 2026
c483e2f
Address reviewer feedback: error finishes request, Claude abort, tests
roblourens Mar 4, 2026
d2aafc4
Add permission request IPC round-trip (Written by Copilot)
roblourens Mar 4, 2026
75e20e6
Remove Claude agent from agent-host process
roblourens Mar 4, 2026
7f58a00
Wire up permission confirmation UI with ChatToolInvocation (Written b…
roblourens Mar 4, 2026
a29498c
Merge remote: remove Claude agent from agent-host (Written by Copilot)
roblourens Mar 4, 2026
5517e45
Fix reviewer feedback: safe permission serialization, deny on abort/d…
roblourens Mar 4, 2026
7f0584c
Forward reasoning events as thinking blocks (Written by Copilot)
roblourens Mar 4, 2026
26d9590
Pass workspace folder as workingDirectory to Copilot SDK (Written by …
roblourens Mar 4, 2026
2ab2b20
Store and pass workingDirectory on session resume, update gap docs (W…
roblourens Mar 4, 2026
f029b63
Fix permission rendering, session-scoped permissions, and test gaps (…
roblourens Mar 4, 2026
03ee61a
Auto-approve read permissions inside workspace folder (Written by Cop…
roblourens Mar 4, 2026
69ef295
Move read auto-approve into CopilotAgent where permission policy belo…
roblourens Mar 4, 2026
5d5675c
Update gap docs (Written by Copilot)
roblourens Mar 4, 2026
c80fd14
Use log language for IPC output channel, add trace prefix (Written by…
roblourens Mar 4, 2026
5f160c1
Add tool rendering gaps to docs (Written by Copilot)
roblourens Mar 4, 2026
3b0b065
Stringify URIs in IPC output channel for readability (Written by Copi…
roblourens Mar 4, 2026
a130005
Fix IPC output channel: use log languageId with non-log channel for p…
roblourens Mar 5, 2026
3598270
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 5, 2026
ba043be
Fix build errors: add URI import, fix test mock types (Written by Cop…
roblourens Mar 5, 2026
d5007bd
Don't localize agent host provider strings (Written by Copilot)
roblourens Mar 5, 2026
46d2288
Remove claude-agent-sdk from eslint allowed imports (Written by Copilot)
roblourens Mar 5, 2026
90cbc37
fix test
roblourens Mar 5, 2026
6547624
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 5, 2026
7d2eccc
initial thoughts
connor4312 Mar 6, 2026
30ee367
Agent host protocol initial thoughts (#299839)
connor4312 Mar 6, 2026
6bcaba3
Rename folder to agentHost
roblourens Mar 10, 2026
1c93387
Fix paths
roblourens Mar 11, 2026
073348b
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 11, 2026
d94d2ce
Fixes
roblourens Mar 11, 2026
d42f19e
Fixes for copilot
roblourens Mar 11, 2026
f1239c8
Fix moduleignore
roblourens Mar 11, 2026
e929975
first working protocol version
connor4312 Mar 8, 2026
fce44be
cleanup
connor4312 Mar 11, 2026
3546468
Merge pull request #300929 from microsoft/connor4312/agent-host-adopt
connor4312 Mar 11, 2026
076b448
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 11, 2026
3e15c2d
agentHost: hello world from server
connor4312 Mar 12, 2026
cb1bf5f
Fix copilot pty.node packaging
roblourens Mar 12, 2026
9daef69
Fix test
roblourens Mar 12, 2026
cb51cb4
prebuild packaging
roblourens Mar 12, 2026
f063b42
Agenthost server fixes
roblourens Mar 12, 2026
dffac9c
Merge remote-tracking branch 'origin/main' into roblou/agent-host
roblourens Mar 12, 2026
1acb493
Update monaco.d.ts
roblourens Mar 12, 2026
e609a5f
Update docs
roblourens Mar 12, 2026
b01643c
Fixes
roblourens Mar 12, 2026
71f14d3
Merge branch 'roblou/agent-host' into connor4312/agent-host-server
connor4312 Mar 12, 2026
9911846
cleanup
connor4312 Mar 12, 2026
aff48ba
Build fix
roblourens Mar 12, 2026
eea22c1
Fix build issues
roblourens Mar 12, 2026
c0fdec6
reduce duplication in side effecting code
connor4312 Mar 12, 2026
8bc176b
fix model switching not working
connor4312 Mar 12, 2026
53372c0
reduce mock duplication
connor4312 Mar 12, 2026
6c405bf
Build fixes
roblourens Mar 12, 2026
8726f11
Merge remote-tracking branch 'origin/roblou/agent-host' into connor43…
connor4312 Mar 12, 2026
813d943
scary--; hacky++;
connor4312 Mar 12, 2026
14160da
Copy vscode's node.pty
roblourens Mar 12, 2026
f4a66a7
And ripgrep
roblourens Mar 12, 2026
1617f8d
And thsi
roblourens Mar 12, 2026
fa411a7
Ripgrep goes to non-SDK
roblourens Mar 13, 2026
354c914
Skip copy for stable build
roblourens Mar 13, 2026
594e560
Remove outdated script
roblourens Mar 13, 2026
5c16c31
Connect to remote agent hosts via setting chat.remoteAgentHosts (#301…
roblourens Mar 13, 2026
87b8080
Merge remote-tracking branch 'origin/roblou/agent-host' into connor43…
roblourens Mar 13, 2026
222bbd4
add agent-host command for cli
connor4312 Mar 13, 2026
2da8aa0
better command detection
connor4312 Mar 13, 2026
247bd10
parse error
connor4312 Mar 13, 2026
b1781a1
add instructions for agent host development
connor4312 Mar 13, 2026
5983e79
make active sessions participant in remote-auto-shutdown
connor4312 Mar 13, 2026
60c18f3
auto updating agent host in the cli
connor4312 Mar 13, 2026
706e49e
Remote agenthost management fixes
roblourens Mar 13, 2026
f8311c3
protocol parity
connor4312 Mar 13, 2026
4393d06
Skip quality check when VSCODE_CLI_OVERRIDE_SERVER_PATH is set and lo…
roblourens Mar 13, 2026
5d3c95e
Nicer placeholder for remote agent hosts
roblourens Mar 14, 2026
b350c3b
agentHost: add AgentHostNewSession for remote agent host sessions
roblourens Mar 14, 2026
10d159c
Hide "local" delegation picker for remote sessions
roblourens Mar 14, 2026
ce5e503
Add directory listing to protocol, and folder picker for remote agent…
roblourens Mar 14, 2026
97ef00d
Align browseDirectory errors with filesystem semantics (Written by Co…
roblourens Mar 14, 2026
f24e3be
Avoid timeouts in tests
roblourens Mar 14, 2026
ba58596
adopt tool call changes from https://github.com/microsoft/agent-host-…
connor4312 Mar 14, 2026
3da3823
Merge remote-tracking branch 'origin/main' into connor4312/agent-host…
roblourens Mar 16, 2026
c5ea6d2
Fix tests
roblourens Mar 16, 2026
5d5d076
fix build
connor4312 Mar 17, 2026
f48e040
fix build
roblourens Mar 17, 2026
f2f31ca
connection token support
connor4312 Mar 17, 2026
9fbb42c
fix tests
connor4312 Mar 17, 2026
927a093
fix
connor4312 Mar 17, 2026
7b55ecc
replace eye icon with file icon for read-only agent .md files in mode…
Copilot Mar 17, 2026
6076e77
Clean up dead code
roblourens Mar 17, 2026
c30d944
Fix sessions e2e test web launch
roblourens Mar 17, 2026
7b40408
fix e2e tests
connor4312 Mar 17, 2026
91ade91
cleanup
connor4312 Mar 17, 2026
fa0c6f0
Revert "Fix sessions e2e test web launch"
roblourens Mar 17, 2026
1c035e8
Merge branch 'main' into connor4312/agent-host-server
roblourens Mar 17, 2026
ec151c3
Merge branch 'main' into copilot/replace-eye-icon-with-document-icon
eli-w-king Mar 17, 2026
5346fa3
Restore ChatImageCarouselService
roblourens Mar 17, 2026
d835cce
Fix dead link in agent plugins documentation
connor4312 Mar 17, 2026
77c1d46
Merge remote-tracking branch 'origin/main' into connor4312/agent-host…
roblourens Mar 17, 2026
fe3e9a7
Move URL out of browser URI (#302542)
kycutler Mar 17, 2026
612a31d
Merge branch 'main' into copilot/replace-eye-icon-with-document-icon
eli-w-king Mar 17, 2026
eaa6b0a
windows task should not use /d
benibenj Mar 17, 2026
0b714cb
Merge pull request #302575 from microsoft/fix/agent-plugin-doc-link
connor4312 Mar 17, 2026
b15cfcf
aiCustomization: prompt to uninstall plugin when removing plugin-prov…
connor4312 Mar 17, 2026
fd89486
plugins: clear enablement state on marketplace plugin uninstall (#302…
connor4312 Mar 17, 2026
888a6c5
Merge pull request #301140 from microsoft/connor4312/agent-host-server
roblourens Mar 17, 2026
c441b78
Merge pull request #302564 from microsoft/copilot/replace-eye-icon-wi…
eli-w-king Mar 17, 2026
84c4f36
fix mcp shimmer + better working progress (#302587)
justschen Mar 17, 2026
5647609
Merge pull request #302591 from microsoft/benibenj/chubby-ostrich
benibenj Mar 17, 2026
f2068d3
fix: create agent feedback editor widgets in reverse order for correc…
benibenj Mar 17, 2026
3aa085f
fix disposable leak + fix empty thinking container (#302595)
justschen Mar 17, 2026
3ad62b4
chat customizations: counts next to each sub section (#302593)
joshspicer Mar 17, 2026
d87bb19
mcp: make gateway spawn a gateway per mcp rather than a combined gate…
connor4312 Mar 18, 2026
00c8ff7
fix: update button hint color to match background for better visibili…
joshspicer Mar 18, 2026
5d7e4c1
chat: populate githubRepo for GitUri marketplace references (#302596)
connor4312 Mar 18, 2026
e8efa92
fix: update hover selector for navigation arrows in image carousel
rebornix Mar 18, 2026
ea5ef75
Sessions: Unified project picker and target mode picker (#302375)
sandy081 Mar 18, 2026
d1cb3f5
better progress rendering for thinking vs. normal progress (#302615)
justschen Mar 18, 2026
9724cf9
Merge pull request #302621 from microsoft/rebornix/continuous-heron
rebornix Mar 18, 2026
8a3bfca
Reverting sandbox manager changes in main. (#302625)
dileepyavan Mar 18, 2026
42fadb3
plugins: add manage plugin marketplaces command (#302631)
connor4312 Mar 18, 2026
2418b24
agentHost: migrate to use protocol types
connor4312 Mar 18, 2026
2a03980
Merge remote-tracking branch 'origin/main' into connor4312/agent-host…
connor4312 Mar 18, 2026
358fba6
plugins: support flat MCP server map format in .mcp.json (#302583)
connor4312 Mar 18, 2026
2cd7a84
tests and build
connor4312 Mar 18, 2026
070688f
fix #302202 fix #301997 Deduplicate consecutive carousel images and a…
rebornix Mar 18, 2026
12373f4
revert disposable handling of newly created tools. (#302646)
justschen Mar 18, 2026
b5def30
Merge pull request #302639 from microsoft/connor4312/agent-host-types2
connor4312 Mar 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .agents/skills/launch/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,30 @@ agent-browser snapshot -i
- Code OSS uses the default user data directory. Unlike VS Code Insiders, you don't typically need `--user-data-dir` since there's usually only one Code OSS instance running.
- If you see "Sent env to running instance. Terminating..." it means Code OSS is already running and forwarded your args to the existing instance. Quit Code OSS and relaunch with the flag, or use `--user-data-dir=/tmp/code-oss-debug` to force a new instance.

## Launching the Sessions App (Agent Sessions Window)

The Sessions app is a separate workbench mode launched with the `--sessions` flag. It uses a dedicated user data directory to avoid conflicts with the main Code OSS instance.

```bash
cd <repo-root> # the root of your VS Code checkout
./scripts/code.sh --sessions --remote-debugging-port=9224
```

Wait for the window to fully initialize, then connect:

```bash
# Wait for Sessions app to start, retry until connected
for i in 1 2 3 4 5; do agent-browser connect 9224 2>/dev/null && break || sleep 3; done

# Verify you're connected to the right target (not about:blank)
agent-browser tab
agent-browser snapshot -i
```

**Tips:**
- The `--sessions` flag launches the Agent Sessions workbench instead of the standard VS Code workbench.
- Set `VSCODE_SKIP_PRELAUNCH=1` to skip the compile step if you've already built.

## Launching VS Code Extensions for Debugging

To debug a VS Code extension via agent-browser, launch VS Code Insiders with `--extensionDevelopmentPath` and `--remote-debugging-port`. Use `--user-data-dir` to avoid conflicting with an already-running instance.
Expand Down
27 changes: 27 additions & 0 deletions .github/instructions/agentHostTesting.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
description: Architecture documentation for VS Code AI Customization view. Use when working in `src/vs/workbench/contrib/chat/browser/aiCustomization`
applyTo: 'src/vs/platform/agentHost/**'
---

# Agent Host

The agent host communicates via the Agent Host Protocol. The specification for this lives in a directory `../agent-host-protocol` as a sibling of the VS Code directory.

If this directory doesn't exist, you should use the "ask questions" tool to ask the user if they want to clone `git@github.com:microsoft/agent-host-protocol.git` to that directory. After doing so, you should also prompt the user to add `file:///<path/to/agent-host-protocol>/plugins/copilot-plugin` as a plugin in their `chat.pluginLocations` settings.

## Overall Protocol

The sessions process is a portable, standalone server that multiple clients can connect to. Clients see a synchronized view of sessions and can send commands that are reflected back as state-changing actions. The protocol is designed around four requirements:

1. **Synchronized multi-client state** — an immutable, redux-like state tree mutated exclusively by actions flowing through pure reducers. While there is the option to implement functionality via imperative commands, we ALWAYS prefer to model features as pure state and actions.
2. **Lazy loading** — clients subscribe to state by URI and load data on demand. The session list is fetched imperatively. Large content (images, long tool outputs) is stored by reference and fetched separately.
3. **Write-ahead with reconciliation** — clients optimistically apply their own actions locally, then reconcile when the server echoes them back alongside any concurrent actions from other clients or the server itself.
4. **Forward-compatible versioning** — newer clients can connect to older servers. A single protocol version number maps to a capabilities object; clients check capabilities before using features.

See the agent host protocol documentation for more details.

## End to End Testing

You can run `node ./scripts/code-agent-host.js` to start an agent host. If you pass `--enable-mock-agent`, then the `ScriptedMockAgent` will be used.

By default this will listen on `ws://127.0.0.1:8081`. You can then use the `ahp-websocket` client, when available, to connect to and communicate with it.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"extensions/terminal-suggest/src/completions/upstream/**": true,
"test/smoke/out/**": true,
"test/automation/out/**": true,
"src/vs/platform/agentHost/common/state/protocol/**": true,
"test/integration/browser/out/**": true,
// "src/vs/sessions/**": true
},
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
"type": "shell",
"command": "npm ci && npm run watch",
"windows": {
"command": "cmd /d /c \"npm ci && npm run watch\""
"command": "cmd /c \"npm ci && npm run watch\""
},
"inSessions": true,
"runOptions": {
Expand Down
16 changes: 9 additions & 7 deletions build/npm/postinstall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,13 +292,15 @@ async function main() {
// Temporary: patch @github/copilot-sdk session.js to fix ESM import
// (missing .js extension on vscode-jsonrpc/node). Fixed upstream in v0.1.32.
// TODO: Remove once @github/copilot-sdk is updated to >=0.1.32
const sessionFile = path.join(root, 'node_modules', '@github', 'copilot-sdk', 'dist', 'session.js');
if (fs.existsSync(sessionFile)) {
const content = fs.readFileSync(sessionFile, 'utf8');
const patched = content.replace(/from "vscode-jsonrpc\/node"/g, 'from "vscode-jsonrpc/node.js"');
if (content !== patched) {
fs.writeFileSync(sessionFile, patched);
log('.', 'Patched @github/copilot-sdk session.js (vscode-jsonrpc ESM import fix)');
for (const dir of ['', 'remote']) {
const sessionFile = path.join(root, dir, 'node_modules', '@github', 'copilot-sdk', 'dist', 'session.js');
if (fs.existsSync(sessionFile)) {
const content = fs.readFileSync(sessionFile, 'utf8');
const patched = content.replace(/from "vscode-jsonrpc\/node"/g, 'from "vscode-jsonrpc/node.js"');
if (content !== patched) {
fs.writeFileSync(sessionFile, patched);
log(dir || '.', 'Patched @github/copilot-sdk session.js (vscode-jsonrpc ESM import fix)');
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion cli/src/bin/code/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::process::Command;

use clap::Parser;
use cli::{
commands::{args, serve_web, tunnels, update, version, CommandContext},
commands::{agent_host, args, serve_web, tunnels, update, version, CommandContext},
constants::get_default_user_agent,
desktop, log,
state::LauncherPaths,
Expand Down Expand Up @@ -103,6 +103,10 @@ async fn main() -> Result<(), std::convert::Infallible> {
serve_web::serve_web(context!(), sw_args).await
}

Some(args::Commands::AgentHost(ah_args)) => {
agent_host::agent_host(context!(), ah_args).await
}

Some(args::Commands::Tunnel(mut tunnel_args)) => match tunnel_args.subcommand.take() {
Some(args::TunnelSubcommand::Prune) => tunnels::prune(context!()).await,
Some(args::TunnelSubcommand::Unregister) => tunnels::unregister(context!()).await,
Expand Down
1 change: 1 addition & 0 deletions cli/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

mod context;

pub mod agent_host;
pub mod args;
pub mod serve_web;
pub mod tunnels;
Expand Down
Loading
Loading