Commit Graph

728 Commits

Author SHA1 Message Date
dileepyavan be5b7e42b7 Updates for windows sandboxing (#323062) 2026-06-26 20:18:47 +00:00
Anthony Kim 8a9cd3dd36 Bump Copilot CLI package to 1.0.65 (#322747)
* Bump Copilot CLI package to stable 1.0.64

* Try to bump to 1.0.65 instead

* Remove stale Copilot sdk/worker materialization for 1.0.65

* Update Debian amd64 deps after excluding Copilot native executable

* Remove stale RPM x64 libstdc++ deps after Copilot CLI 1.0.65 packaging

* Prune Copilot SEA executable before CI packaging

* Exclude Copilot SEA executable from packaging stream

* SDK should be 1.0.4
2026-06-25 12:03:54 -07:00
Anthony Kim 1c0b4bea4c Bump Copilot CLI SDK packages to 1.0.64-1 / 1.0.3 (#322645)
* Bump Copilot CLI packages to @github/copilot@1.0.64-1 and @github/copilot-sdk@1.0.3

* Resolve Agent Host Copilot CLI through @github/copilot/bin.copilot

* Materialize @github/copilot/sdk from @github/copilot-<platform> in extension postinstall

* Package @github/copilot-<platform>/copilot for Agent Host and linuxmusl

* Exclude Copilot optional native payloads from extension package

* Scan @github/copilot-*/copilot for Linux package dependencies

* Tighten Copilot SDK 1.0.64-1 attachment and RPC typings

* Increase Copilot SDK native binary scan test timeout

* Update amd64 deb deps for @github/copilot-linux-x64/copilot

* Update arm64 rpm deps for Copilot package layout

* Update x64 rpm deps for @github/copilot-linux-x64/copilot

* Try to fix windows smoke test

* Try to fix platform runtime files for agent host

* exclude copilot computer.node from agent host packaging

* Another attempt to try to get packaging right

* Should only try to load 1.0.64-1

* Try to fix packaing for windows, macos, deb deps

* Update armhf/arm64 deb and x64 rpm Copilot dependency baselines

* Copilot darwin ripgrep universal merge and arm64 rpm deps

* Restore target Copilot SDK prebuilds for built-in extension packaging

* see if changes to gulpfile.reh.ts would help

* dont mess with formatting

* Launch copilot cli from platform index.js and exclude SEA
2026-06-24 06:47:26 -07:00
Tyler James Leonhardt e6f4d6c6f2 Avoid CPU-pegging process report in libc detection (#322260)
* Avoid CPU-pegging process report in libc detection

detectLibc() called process.report.getReport() on every Linux process to
tell glibc from musl. That report serializes heap, native stack and libuv
state, and the network/socket enumeration can peg the CPU on busy hosts.

Detect cheapest-first instead: parse the ELF PT_INTERP dynamic-linker path
from the head of /proc/self/exe, then string-match the head of /usr/bin/ldd,
and only fall back to the process report (now with excludeNetwork = true to
skip the expensive libuv section, also inspecting sharedObjects). Default to
glibc when nothing is conclusive.

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

* Read ELF64 offsets as 64-bit with safe-integer guards

Address PR review: e_phoff, p_offset and p_filesz are 64-bit fields in
ELF64. Read them via readBigUInt64LE through a bounded helper that rejects
values past Number.MAX_SAFE_INTEGER, validate e_phentsize covers a full
Elf64_Phdr, and widen the per-entry bounds check to the 8-byte p_filesz.

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

* Use detect-libc package instead of hand-rolled libc detection

Replace the bespoke ELF/ldd/process-report probing in detectLibc() with the
detect-libc package (already present transitively, now a direct dependency).
It performs the same cheapest-first detection and sets process.report's
excludeNetwork flag internally, so the CPU-pegging libuv enumeration is still
avoided without us maintaining the ELF parser. Add detect-libc to the
hasNode import allowlist in eslint.config.js.

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

* Declare detect-libc in remote/package.json

detectLibc() (via agentSdkDownloader) is reached from agentHostServerMain,
so the server/REH build requires detect-libc. It was only present in the
remote node_modules transitively (through @parcel/watcher); declare it
directly to match the root manifest and the direct import.

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

* Rename detectLibc to detectLibcSync

Signal the blocking nature in the name and leave room for a future
promise-based detectLibc that wraps detect-libc's async family(). Update
the agentSdkDownloader consumer and the unit test.

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-21 19:43:34 -07:00
Don Jayamanne a0c54ca2e9 Update GitHub Copilot and SDK versions to 1.0.64-0 in package and package-lock files (#322020)
* Update GitHub Copilot and SDK versions to 1.0.64-0 in package and package-lock files

* Increase timeout for CopilotAgent tests to 30 seconds
2026-06-19 16:35:16 +02:00
Don Jayamanne e364243a0d chore: update @github/copilot to version 1.0.63 (#321608)
* chore: update @github/copilot to version 1.0.63 in package.json and package-lock.json

* chore: update @github/copilot to version 1.0.63 in package.json and package-lock.json
2026-06-17 09:35:41 +10:00
Don Jayamanne 847d569028 chore: update @github/copilot and related dependencies to version 1.0.61 (#320868)
* chore: update @github/copilot and @github/copilot-sdk to version 1.0.61 and 1.0.1 respectively

- Bump @github/copilot from 1.0.60 to 1.0.61 in package.json and package-lock.json
- Update @github/copilot-sdk from 1.0.0 to 1.0.1 in package.json and package-lock.json
- Modify postinstall script to copy tgrep files instead of sharp files
- Update tests to include tgrep binaries
- Change model in e2e tests from 'claude-opus-4.7' to 'gpt-5-mini'

* fix: add libm.so.6(GLIBC_2.27)(64bit) to referenceGeneratedDepsByArch
2026-06-11 20:46:55 +10:00
Tyler James Leonhardt f57a83c819 Distribute Claude and Codex agent SDKs via product.json (#320709)
* Add tar to REH dependencies and eslint allowlist

The agent SDK downloader uses node-tar to extract the per-platform
SDK tarballs it downloads from product.json — pure JS, zero native
deps, so the agent host works on every server install footprint
without relying on a system tar binary.

* Distribute Claude and Codex agent SDKs via product.json

Adds IAgentSdkDownloader, which fetches the per-platform Claude
and Codex SDKs from a CDN configured through product.agentSdks
(populated by vscode-distro), verifies the sha256 anchored in
product.json, and caches the extracted root under userDataPath.
Providers register iff the SDK is available — either a dev override
env var or a product.agentSdks entry whose sha256 declares the
current platform. Falls through to today's no-op behavior in OSS
builds with neither.

Tracks microsoft/vscode-internalbacklog#7885.

* Fix lockfiles after merge resolve

The previous merge took upstream's @anthropic-ai/sdk@0.82.0 in
package.json but left the lock file's nested resolution tree
pointing at 0.102.0, so npm ci rejected the workspace. Re-resolve
via npm install. Also adds the remote/package-lock.json entry for
tar that was missed in the first commit.

* Address PR review feedback

- nodeAgentHostStarter: pass process.env (not the local shell-env
  snapshot) to buildAgentSdkEnv so a developer's env-var dev override
  actually wins over a settings value. Matches electronAgentHostStarter.
- agentSdkDownloader: write the .complete sentinel inside tmpDir BEFORE
  the move so cache publish is atomic. A crash between move and
  sentinel-write previously left a wedged cacheDir that subsequent runs
  could not recover from (rename-loser path requires a valid sentinel).
- agentHostBootstrap: register RequestService with the DisposableStore
  so its config-change listener is cleaned up at shutdown.
- agentSdkDownloader.test: build the fixture tarball via node-tar
  (already a dep) instead of spawning the host tar binary; drops the
  bsdtar/gnutar portability surface.
- agentHostMain: comment referenced the renamed VSCODE_AGENT_HOST_*_PATH
  env var; corrected to VSCODE_AGENT_HOST_*_SDK_ROOT.

* Drop test-stub fields not present in @anthropic-ai/sdk 0.82

The earlier merge took upstream's @anthropic-ai/sdk@0.82.0 over the
stash's 0.102.0; some test stubs had been authored on a branch using
0.102.0 and reference fields that don't exist in 0.82
(output_tokens_details, estimated_tokens, diagnostics on BetaMessage).
Strip the optional fields — they're shape-only filler in the test
fixtures and aren't asserted on.
2026-06-10 14:20:12 -07:00
Megan Rogge 4b47f077e4 xterm@6.1.0-beta.285 (#320646)
Diff: https://github.com/xtermjs/xterm.js/compare/6.1.0-beta.220...6.1.0-beta.285

Updates @xterm/* from beta.220 to beta.285 (addon-webgl to beta.284, its latest published).

Co-authored-by: Megan Rogge <meganrogge@Megans-MacBook-Pro.local>
2026-06-09 19:04:24 +00:00
Don Jayamanne 8ad4bc41d2 chore: update @github/copilot to version 1.0.60 in package.json and package-lock.json (#320521)
* chore: update @github/copilot to version 1.0.60 in package.json and package-lock.json

* chore: update @github/copilot to version 1.0.60 in package.json and package-lock.json

* test: update feature flag service creation in Copilot CLI tests
2026-06-08 22:25:38 -07:00
Don Jayamanne 764764d15c Update GitHub Copilot and SDK dependencies to latest versions (#319677) 2026-06-03 16:06:08 +02:00
dileepyavan b70081faab [Windows-Sandboxing] Update MXC sdk package to 0.6.0 (#319649)
mxc_upgrade
2026-06-02 16:34:23 -07:00
Robo 294fb35083 build: pin node-addon-api 6.x at root to avoid MSBuild tlog race (#319398) 2026-06-02 10:15:00 +09:00
dileepyavan e1a9625b76 [Windows_Sandboxing]Refactoring config creation for windows sandboxing and upgrading mxc (#318865)
* refactoring config creation for windows sandboxing and upgrading mxc package

* Avoid MXC SDK imports in shared sandbox contract

* fixing tests
2026-05-29 23:02:29 +00:00
Robo b0bdc05bbb fix: zip inflate with yauzl on node v24.16.0 (#318682) 2026-05-29 17:01:24 +10:00
Rob Lourens 98abbd3140 Bump @github/copilot-sdk to 1.0.0-beta.8 (#318683)
* Bump @github/copilot-sdk to 1.0.0-beta.8 (Written by Copilot)

Also bumps @github/copilot CLI to 1.0.55-3 to satisfy the SDK's
`^1.0.55-1` peer requirement.

Key SDK breaking changes adapted in `src/vs/platform/agentHost/`:

- `CopilotClientOptions`: `useStdio`/`cliPath`/`autoStart` →
  `connection: RuntimeConnection.forStdio({ path })`; `remote` →
  `enableRemoteSessions`.
- `SessionContext.cwd` → `workingDirectory`.
- `CopilotSession.getMessages()` → `getEvents()`,
  `destroy()` → `disconnect()`.
- `PermissionRequest` is now a discriminated union; the host-side
  `ITypedPermissionRequest` is no longer `extends PermissionRequest` but
  a standalone bag-of-optionals interface so existing call sites continue
  to work. Extended host signal with the new `extension-management` /
  `extension-permission-access` kinds.
- `BaseHookInput`: `timestamp: number` → `Date`, `cwd` →
  `workingDirectory`, new required `sessionId`.
- `Tool.handler` is now optional — tests use `tool.handler!(...)`.
- `ToolBinaryResult.type` narrowed to literal `'image' | 'resource'`.
- `AssistantUsageData.copilotUsage` and `ShutdownData.totalPremiumRequests`
  removed; corresponding accumulation/trace code dropped.

Validation: 0 TS errors, layers check passes, all 1357 agent-host unit
tests pass. Real-SDK integration tests: 9/11 passing. Two failures
documented in the session plan:

- plan-mode session-state test times out (likely needs migration of the
  `_enablePlanModeOnClient` shim to the new public
  `SessionConfig.onExitPlanModeRequest`).
- subagent-routing test: `read_agent` now appears on the parent session
  (likely a CLI 1.0.55 behavior change).

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

* Fix broken @github/copilot-win32-x64 entry in remote/package-lock.json

The committed remote/package-lock.json had a malformed stub entry:

  "node_modules/@github/copilot/node_modules/@github/copilot-win32-x64": {
    "optional": true
  }

with no version field, which caused npm install to crash with:

  TypeError: Invalid Version:
      at Node.canDedupe (.../@npmcli/arborist/lib/node.js:1137:32)
      at PlaceDep.pruneDedupable (.../@npmcli/arborist/lib/place-dep.js:426:14)

Replaced with a proper top-level node_modules entry for
@github/copilot-win32-x64@1.0.55-3 (matches the resolution used for
the other platform optionals on the @github/copilot dep). This is what
npm naturally produces when regenerating the lockfile from scratch.

Fixes the failing 'Install dependencies' step on the macOS / Remote
CI job.

(Written by Copilot)

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

* Bump deb amd64 libc6 floor to 2.15 for new @github/copilot runtime.node

The new @github/copilot 1.0.55-3 ships a Linux x64 runtime.node that
references GLIBC_2.15 (was GLIBC_2.14 in 1.0.49). dpkg-shlibdeps now
emits libc6 (>= 2.15) for amd64; update the reference list so the deb
prepare task no longer fails the build.

Only amd64 is affected: arm64 runtime.node GLIBC version set is
unchanged, and @github/copilot does not ship an armhf binary. The
overall libc6 floor for the package is still 2.28, so distro support
is unchanged.

(Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-28 15:50:15 -07:00
Osvaldo Ortega d53d505759 Render cloud task history from typed session events (#318646)
* CAPI package update

* Missindg updates

* Missing lock

* Render cloud task history from typed events

- Extract shared session-event-to-chat-parts renderer into
  chatSessions/common/sessionEventRenderer.ts so both the Copilot CLI
  and Cloud Tasks providers produce identical tool/text formatting.
- Render Task API history via the shared renderer, remapping
  custom_agent.* to the equivalent subagent.* names so tool cards,
  bash terminal output, edits, search results, MCP results and
  subagent groups all render the same way they do in the CLI.
- Match github.com/github/github-ui presentation by suppressing
  intermediate assistant.message events that echo tool input/output
  and only rendering the final summary message per turn.

* Address review: break circular dep & restore flush timing

- Inject CLI tool-event handlers (processStart/processComplete/
  enrichSubagent/isEditToolCall/getEditedUris) into the shared
  renderer via a ToolEventHandlers<T> bundle, so common/sessionEventRenderer
  no longer imports from copilotcli/. Layering now only flows one way.
- Flush buffered assistant.message_delta chunks at the top of the
  CLI loop for non-message events so the session.model_change /
  assistant.usage guards see streamed text exactly the way the
  pre-extraction code did.

* Missing lock changes

* Revert unintended copilot package manifest edits

* Revert unintended root package manifest edits

* remote package revert

* lock

---------

Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com>
2026-05-28 10:59:15 -07:00
dileepyavan 0fd3a3d234 [WindowsSandboxing]: Updated env and commandline for executing commands using pwsh.exe (#318466)
* Exclude MXC SDK catalog manifests from Authenticode checks

* Exclude MXC executables from VersionInfo sanity check

* Exclude MXC bin from VersionInfo sanity check

* investigation

* fixing issue for pwsh execution

* fixing issue for pwsh execution
2026-05-27 11:46:57 -07:00
Osvaldo Ortega 72c29a534a CAPI package update (#318481) 2026-05-27 05:35:29 +00:00
Anthony Kim 103a85ad83 Update xterm.js to 6.1.0-beta.220 (#317936)
* Update xterm.js to 6.1.0-beta.220

* Stop the weirdness with cpu-features on package-lock.json
2026-05-26 16:51:36 -07:00
Anthony Kim 79ff5c49e7 Bump Agent host Copilot CLI to 1.0.49 (#317241)
* Bump Agent host Copilot CLI to 1.0.48

* Copilot Cli to 1.0.48 sdk to 1.0.0-beta.4

* Exclude pvrecorder, foundry-local-sdk, mxc-bin

* Parity for copilot/sharp

* Add back missing binary

* Update dependencies for public copilot cli sdk

* remove icu-native.node for now

* Remove win32-native.node, icu-native.node

* Bump both internal and public to 1.0.49

* Only copy required Copilot SDK prebuilds

* Fix Copilot SDK native binary handling
2026-05-21 23:43:38 +00:00
Logan Ramos a2d2b10956 Long context pricing (#317820)
* Long context pricing

* Fix
2026-05-21 15:00:31 -07:00
dileepyavan e7137a3065 Integrating MXC for windows sandboxing (#317669)
* draft version

* draft version

* adding mxc for windows sandboxing

* Potential fix for pull request finding

Merging readwritePaths

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

* cleaning up PR

* cleaning up

* Run Windows MXC commands directly

* Pin MXC SDK lockfiles

* fixing tests and cleaning up env variables

* adding a flag for windows sandboxing as its experimental

* adding a flag for windows sandboxing as its experimental

* adding a flag for windows sandboxing as its experimental

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-21 13:17:09 -07:00
Robo 9cd7264dd1 feat(copilot): opt-in HTTP cache for the Node fetch fetcher (#317721)
* feat(copilot): opt-in HTTP cache for the Node fetch fetcher

Adds an opportunistic cache support to the Copilot Node fetch path. The cache
is strictly opt-in per request and composes with the existing VSCode proxy
and CA-injection patch.

- `__vscodeCreateFetchPatch({ interceptors })` lets the extension host
  build a second proxy-aware `fetch` with extra undici interceptors. The
  default `__vscodePatchedFetch` is unchanged.
- `NodeFetchFetcher` builds an undici cache interceptor once at
  construction time and uses the factory to produce a `cachedFetch` that
  routes through both the proxy patch and the cache. Requests are tagged
  with an internal `__copilotCachePatch` marker (stripped before fetch);
  unmarked requests keep going through the regular patched fetch. When
  the host lacks the factory, caching is silently disabled so requests
  never bypass the proxy patch.
- `FetchOptions.cache?: boolean` — opportunistic hint. Fetchers without
  cache support ignore it; fallback to other fetchers is unaffected.
- `Response.cacheStatus` and `FetchTelemetryEvent.cacheStatus`:
  `'hit' | 'stale-hit' | 'revalidated' | 'miss' | 'bypass'`.
- New setting `github.copilot.advanced.debug.nodeFetchCache`:
  `'off' | 'memory' | 'persistent'` (default `'memory'`). `'persistent'`
  uses undici's SQLite store under the extension's global storage
  (`undici-cache.v1.sqlite`) when available, otherwise falls back to
  memory.
- New `taggedCacheInterceptor` wraps `undici.interceptors.cache` and
  stamps a private `VSCODE_CACHE_STATUS_HEADER` on the response so the
  base fetcher can read the outcome without parsing undici internals.
- `BaseFetchFetcher` exposes an overridable `_buildRequestInit` hook and
  reports `cacheStatus` on `Response` and `fetchTelemetry`.

Notes
- No behavior change for callers that don't set `cache: true`.
- The cache interceptor is constructed once per fetcher instance; the
  composed dispatcher chain is reused so connection pooling is preserved.
- Depends on https://github.com/microsoft/vscode-proxy-agent/pull/100

For https://github.com/microsoft/vscode/issues/308310

* fix: undici integration tests

- drop the `age` header gate from classify(): undici's cache interceptor
only adds if-modified-since / if-none-match when revalidating a stored
entry, so `state.conditional` alone is a sufficient signal. The age header
is not guaranteed on a revalidated 200, which caused 'revalidated' to be
misreported as 'miss'.

- the etag integration test used
`cache-control: max-age=0, must-revalidate`, which undici treats as
already-stale on arrival and refuses to store (cache-handler.js bails when
`now >= absoluteStaleAt`), so there was nothing to revalidate on the second
call. Switch the origin to `public, max-age=60` and pass
`cache-control: no-cache` on the second request to drive undici's
needsRevalidation() path, which dispatches with if-none-match and serves
the cached body on 304.

* chore: fix lint

* chore: cleanup cache marker in favor of function arg
2026-05-21 18:07:34 +00:00
Tyler James Leonhardt 54eb46af95 claude: Phase 10 — workbench client tools via in-process MCP server (#317685) 2026-05-21 06:27:09 -07:00
Henning Dieterichs c4471e24fa Adopt @vscode/ripgrep-universal (inline binaries, no postinstall)
Replace @vscode/ripgrep with @vscode/ripgrep-universal which bundles all platform binaries in a single package. Non-target platform binaries are stripped at packaging time via getRipgrepExcludeFilter.

- Add shared rgDiskPath() helper in src/vs/base/node/ripgrep.ts
- Convert all ripgrep consumers to use the async helper
- Add getRipgrepExcludeFilter for build packaging
- Update prepareBuiltInCopilotRipgrepShim for new bin layout
- Update eslint allowed-modules and require-interceptor aliases
- Fix platform mapping for Alpine + armhf
- Handle arch-specific binaries in macOS universal build / verify-macho
2026-05-18 18:46:04 +02:00
Anthony Kim 97e8bd51eb Update to node-pty 1.2.0-beta.13 (#316325) 2026-05-13 22:44:24 +00:00
Alexandru Dima 881fa943e7 Revert "agentHost/claude: Phase 6 — sendMessage, single-turn, no tools (#314216)"
This reverts commit dea0d3c24a.
2026-05-05 12:38:51 +02:00
Tyler James Leonhardt dea0d3c24a agentHost/claude: Phase 6 — sendMessage, single-turn, no tools (#314216)
* agentHost/claude: post-Phase-4 cleanup

- roadmap.md: mark Phase 4 as DONE, link merged PR #313780.
- phase4-plan.md: record live-system smoke completion in §7.8;
  disabled-gate run skipped (covered by unit tests + env-var guard).
- claudeAgent.test.ts: drop gratuitous 'as unknown as' cast in the
  CCAModel fixture (literal already matches CCAModelBilling exactly;
  plan §7.4 forbids unsafe casts in tests).

* agentHost/claude: lock Phase 5 implementation plan

Handoff plan for Phase 5 (replace 7 throwing stubs in claudeAgent.ts).
Locked against post-PR-#313841 reality (provisional sessions,
onDidMaterializeSession, 30s empty-session GC) and the IAgent contract
on origin/main.

Decisions captured:
- Non-fork createSession is synchronous and in-memory; fork deferred
  to Phase 6 (throws TODO).
- IClaudeAgentSdkService surface mirrors IAgent (no dir parameter on
  listSessions); SDK loader caches resolved module, retries on
  failure, logs once.
- listSessions joins SDK enumeration with workbench session DB
  metadata via ISessionDataService; per-entry try/catch resilience.
- shutdown() routes per-session teardown through the same
  SequencerByKey<string> used by disposeSession() so concurrent
  shutdown/disposeSession cannot double-dispose a wrapper in Phase 6.
- 14 unit tests defined (12 lifecycle + 2 resolved-config), including
  log-once contract and shutdown/disposeSession race guard.

* agentHost/claude: Phase 5 — IAgent provider skeleton

Lands the ClaudeAgent IAgent provider behind the
'chat.agentHost.claudeAgent.enabled' setting (env gate
VSCODE_AGENT_HOST_ENABLE_CLAUDE=1). Pins
@anthropic-ai/claude-agent-sdk@0.2.112 in workspace + remote/.

Implemented in this phase:
* createSession - non-fork, in-memory wrapper only. Honors
  config.session for restore. The fork path and SDK session
  creation are deferred to Phase 6.
* listSessions - SDK is source of truth; per-session DB read
  is a best-effort overlay (failure never excludes an entry).
* disposeSession / shutdown - routed through a per-session
  SequencerByKey to serialize teardown.
* getDescriptor, getProtectedResources, models,
  onDidSessionProgress, setClientCustomizations,
  setClientTools, onClientToolCallComplete,
  setCustomizationEnabled, authenticate, respondTo*Request -
  minimal Phase-5 wiring.

Stubbed for Phase 6 (throw async 'TODO: Phase 6'):
sendMessage, abortSession, changeModel, getSessionMessages,
plus the createSession fork path.

Tests: 29 unit tests in claudeAgent.test.ts cover the
createSession restore-id path, listSessions overlay resilience,
dispose serialization, and stub surfaces.

Note: provisional / onDidMaterializeSession is intentionally
omitted in Phase 5 (see plan section 3.3.1) - the workbench needs
an immediate sessionAdded until the agent has real materialization
work, which arrives in Phase 6 alongside SDK query() startup.

* agentHost/claude: Phase 6 — sendMessage, single-turn, no tools

Implements the Phase 6 plan: provisional sessions materialize on first sendMessage, route a single-turn prompt through the Anthropic Claude Agent SDK's WarmQuery, and stream SDKMessages back as protocol AgentSignals via a pure mapSDKMessageToAgentSignals reducer.

Tools remain denied (canUseTool: 'deny'); fork moves to Phase 6.5; Plan Mode UI moves to Phase 7.

Highlights:

- ClaudeAgent.sendMessage routes through _sessionSequencer to collapse concurrent first sends into one materialize + N ordered sends.

- _materializeProvisional has two abort gates (post-startup + post-customizationDirectory write) so disposeSession landing mid-materialize cannot leak a WarmQuery subprocess.

- ClaudeAgentSession owns the prompt iterator + per-turn deferreds; mapSDKMessageToAgentSignals is a pure reducer with state owned by the session.

- IClaudeAgentSdkService gains startup() alongside listSessions().

Tests: 43 unit + 2 proxy-backed integration. Council-review fixes (C1 dispose race, C2 missing integration test, S1 cwd-less ratification) included.

* agentHost/claude: address PR review (listSessions resilience, dispose abort)

Two Copilot-reviewer comments on #314216:

1. listSessions: wrap _sdkService.listSessions() in try/catch. AgentService.listSessions fans out across providers via Promise.all; an SDK dynamic-import failure would otherwise nuke every other provider's session list. Now logs and returns [].

2. dispose: abort _provisionalSessions AbortControllers before super.dispose(). Previously a racing first sendMessage parked inside _writeCustomizationDirectory could pass the materialize abort gates and call _sessions.set on a disposed DisposableMap, orphaning the WarmQuery. Aborting first triggers the existing post-customization-write abort gate, which asyncDisposes the WarmQuery.

Tests: 2 new regressions (listSessions empty on SDK throw; agent.dispose() during racing materialize disposes the WarmQuery). 45/45 unit + 2/2 integration pass.
2026-05-05 07:34:01 +00:00
Bryan Chen 75e5aceefd Merge branch 'main' into bryanchen-d/bump-xterm-overview-ruler-fix 2026-05-04 12:54:50 -07:00
Peng Lyu 4341e36ab7 Update remote dependencies (#313923) 2026-05-04 11:32:53 -07:00
dileepyavan e7c6e7ebea Sandbox: AllowNetwork option to allow outgoing traffic in sandbox mode. (#313912)
* changes

* changes

* Fix deprecated sandbox setting fallback

* Changes to include workspaceStorage directory for allowRead

* changes

* updating vscode sandbox runtime version

* Cleaning up the PR

* Fix terminal sandbox allow-network config

* fixing tests

* fixing tests

* Centralize terminal sandbox enablement checks

* Update network filter sandbox mode test
2026-05-03 16:58:50 +00:00
Bryan Chen 5e517570c7 chore(deps): bump @xterm/* to beta.213 to pick up overview ruler dispose fix
Picks up xterm.js commit 08ae141 (xtermjs/xterm.js#5826) which adds dispose / hasRenderer guards in OverviewRulerRenderer and cancels its pending requestAnimationFrame on dispose. This addresses the long-standing 'Cannot read properties of undefined (reading ''dimensions'')' crash tracked in microsoft/vscode#303546.
2026-05-01 16:09:16 -07:00
Connor Peet e8848aa993 comments and polish 2026-04-29 13:14:42 -07:00
Connor Peet e8825bfd05 Merge remote-tracking branch 'origin/main' into connor4312/ah-plan-mode 2026-04-29 11:52:39 -07:00
Connor Peet 75ec86b07f agentHost: implement plan and native autopilot modes 2026-04-29 11:43:46 -07:00
Henning Dieterichs 19b3119b33 Pin @github/copilot to exact 1.0.34 and regenerate lockfiles
The previous reverts only changed the spec to ^1.0.34, but the resolved entries in the lockfiles still pointed at 1.0.38 (with 1.0.38 tarballs and integrity hashes). Since ^1.0.34 satisfies 1.0.38, npm ci would still install the broken version. Pin to exact 1.0.34 in all three package.json files and regenerate the lockfiles.
2026-04-29 16:46:30 +02:00
Henning Dieterichs 6087b944fe Revert "agents: bump @github/copilot to 1.0.38 (#313073)"
This reverts commit 83cbe74699.
2026-04-29 16:46:30 +02:00
Rob Lourens 83cbe74699 agents: bump @github/copilot to 1.0.38 (#313073)
* agents: bump @github/copilot to 1.0.38

Tracks the version pinned in extensions/copilot/package.json. Updates
both root and remote/ package.json + lockfiles. Verified by re-running
the real-SDK 'listModels returns well-shaped model entries' integration
test (AGENT_HOST_REAL_SDK=1).

(Written by Copilot)

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

* fix: skip electron re-download when correct version already present

The macOS/Electron CI job was failing because `electron.ts` unconditionally
deletes `.build/electron` and re-downloads Electron on every invocation.

When integration tests run CSS/HTML tests via `node-electron.sh`, they call
`npm run electron` which triggers this re-download. This can fail due to
transient network errors (e.g. 502 Bad Gateway from GitHub), causing the
integration test step to fail even though Electron was already downloaded
successfully in the dedicated "Download Electron and Playwright" CI step.

Fix: add a `.version` marker file inside `.build/electron` that records the
Electron version, MS build ID, and architecture. On the next invocation,
`main()` reads this marker and returns early if it matches the expected
version, skipping the unnecessary delete-and-re-download cycle.

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/8d0b4207-2616-497e-9a4f-bf8a39671934

Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>

* Revert "fix: skip electron re-download when correct version already present"

This reverts commit e1811ece5b. That
commit was pushed to this PR by another agent and is unrelated to the
@github/copilot bump that this PR is for.

(Written by Copilot)

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

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: roblourens <323878+roblourens@users.noreply.github.com>
2026-04-28 21:00:14 +00:00
dileepyavan bb09e7379b terminal: Disable read all by default (#311850)
* adding allowRead and testing with defaults

* Rename terminal sandbox read allow list

* Remove Copilot settings change from sandbox PR

* changes

* changes

* Updating sandbox runtime package

* Updating tests

* Add macOS test cases for denyRead/allowRead behavior and ~ path handling

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/ec5cf3c2-6c7b-4577-bdbb-8ac3d42bdfb0

Co-authored-by: dileepyavan <52841896+dileepyavan@users.noreply.github.com>

* changes for readonly home dir

* skipping integrated tests for sandbox

* running srt in tmp_dir for linux

* running srt in tmp_dir for linux

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-04-24 11:07:16 -07:00
Rob Lourens 096e5abe9d agentHost: bump @github/copilot to 1.0.34 (#311964)
* Fix broken sessions list
From #311751

Co-authored-by: Copilot <copilot@github.com>

* fix tests

* agentHost: settings followups

- Unrelated: fix local agent host being broken on main following
  some overnight cleanups
- Register a JSON schema for agent session settings (only when they're
  open since it has a perf cost)
- When there are multiple custom approval buttons, show them in a
  dropdown similar to other tool calls.

* Add tests for agent session settings schema registration

* Bump @github/copilot from ^1.0.28 to ^1.0.34

Matches the version used in extensions/copilot.

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

* agentHost: tolerate synthetic Copilot models with empty capabilities

After bumping @github/copilot to 1.0.34, listModels() returns a synthetic
'auto' router entry shaped like { id: 'auto', name: 'Auto', capabilities: {} }.
The SDK's ModelInfo type still declares capabilities.limits.max_context_window_tokens
as required, so reading it crashed _listModels and zeroed out the model list.

Wrap the SDK type in a local ICopilotModelInfo with the actually-optional
fields marked optional, and skip entries lacking max_context_window_tokens
with a warn log instead of throwing.

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

* agentHost: surface synthetic 'auto' model with optional maxContextWindow

Instead of dropping the synthetic 'auto' router model, make
IAgentModelInfo.maxContextWindow optional and pass it through as
undefined when the SDK doesn't report a fixed context window. The
agentHostLanguageModelProvider already handles undefined via '?? 0',
and the protocol state type already had the field optional.

Update the real-SDK listModels test to allow undefined maxContextWindow
and to assert the 'auto' entry is present.

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

---------

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Connor Peet <connor@peet.io>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 19:23:45 +00:00
Rob Lourens a1abedfea0 Update @github/copilot SDK to ^1.0.28 (#311807)
Bump @github/copilot in root and remote package.json to ^1.0.28 to match
the version pinned by the bundled copilot extension (extensions/copilot).

Also adds a real-SDK integration test for listModels that subscribes to
the root state, authenticates, and asserts every model has a well-formed
shape (id, name, numeric maxContextWindow). This guards against SDK
schema drift like the issue in 1.0.34, where the server returned models
with optional capabilities.limits, causing _listModels to throw a
TypeError that _refreshModels silently swallowed (resulting in no models
in the UI).

Drive-by: fix stale provider id 'copilot' -> 'copilotcli' in the same
test file.

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 02:29:53 +00:00
Raymond Zhao 9a60a6f5f9 chore: bump windows-process-tree (#311781) 2026-04-21 23:18:39 +00:00
Rob Lourens 41837b42ae Fix agent host session working directories
(Written by Copilot)
2026-04-11 17:25:43 -07:00
Christof Marti 43f7117748 Surface network errors with proxies (microsoft/vscode#298236) 2026-04-08 08:13:59 +00:00
Rob Lourens 063a61dbb7 agentHost Adopt new tree-sitter (#308352)
* agentHost Adopt new tree-sitter

* Bump in web

* Fix test

* fix tests
2026-04-08 00:41:31 +00:00
Anthony Kim 0e637c9101 Update xterm to beta.197 (#308317) 2026-04-07 15:31:28 -07:00
Anthony Kim 4370953ab5 Update xterm to 6.1.0-beta.196 (#307288) 2026-04-02 12:14:42 -07:00
Connor Peet b6a2a05758 agentHost: include sqlite in server build (#306811)
* agentHost: include sqlite in server build

* fix
2026-04-02 00:03:04 +00:00
Rob Lourens e6e776a4b6 Add SSH remote agent host bootstrap (#304882)
* Add SSH remote agent host bootstrap

Adds a new ISSHRemoteAgentHostService that automates connecting to a
remote machine via SSH, installing the VS Code CLI, starting
'code agent-host', and forwarding the agent host port back through
the SSH tunnel.

- New service interface and types in common/sshRemoteAgentHost.ts
- Full implementation using ssh2 in electron-browser/ with dynamic
  imports to respect layering rules
- Multi-step quick input flow for SSH connection details integrated
  into the remote agent host picker
- 'Connect via SSH' command registered in contributions

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

* Address PR review feedback

- Strip password/privateKeyPath from ISSHAgentHostConnection.config
  so secrets are not exposed to consumers after connect
- Redact connection tokens (?tkn=...) in all log output and error
  messages to prevent credential leakage
- Parse user@host:port format in SSH host input with proper validation
  for port range and missing components
- Guard onDidClose with a closed flag to prevent double-fire when
  dispose and SSH close/error events overlap

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

* SSH working through main process

Co-authored-by: Copilot <copilot@github.com>

* Resolve ssh configs

Co-authored-by: Copilot <copilot@github.com>

* progress

* Granular connect progress, test fix

Co-authored-by: Copilot <copilot@github.com>

* Test, refactor

Co-authored-by: Copilot <copilot@github.com>

* Resolve comments

Co-authored-by: Copilot <copilot@github.com>

* Get rid of cpu-features

* Move to shared process

Co-authored-by: Copilot <copilot@github.com>

* fixes

Co-authored-by: Copilot <copilot@github.com>

* add ssh2 to remote/package.json

* Cleanup and fixes

Co-authored-by: Copilot <copilot@github.com>

* fix

Co-authored-by: Copilot <copilot@github.com>

* fix

Co-authored-by: Copilot <copilot@github.com>

* resolve comments

Co-authored-by: Copilot <copilot@github.com>

* comments

Co-authored-by: Copilot <copilot@github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Raymond Zhao <7199958+rzhao271@users.noreply.github.com>
Co-authored-by: Copilot <copilot@github.com>
2026-03-31 21:37:07 -07:00