Skip to content

agentHost: enable multi-root by default - #342188

Merged
roblourens merged 3 commits into
mainfrom
roblou/agents/enable-agent-host-multi-root-default
Oct 16, 2026
Merged

roblourens merged 3 commits into
mainfrom
roblou/agents/enable-agent-host-multi-root-default

Conversation

@roblourens

@roblourens roblourens commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Summary

Enable multi-root support unconditionally for Copilot, Claude, and Codex agent-host sessions rather than retaining experimental opt-in switches.

  • Remove all three chat.agentHost.*Agent.multiRootEnabled settings and their host-side configuration flags.
  • Always advertise multipleWorkingDirectories and use additional roots for SDK launch/resume, customization discovery, and folder selection.
  • Remove Codex's per-session feature flag while preserving workspace-root inheritance and single-folder behavior.
  • Update unit tests, integration test setup, and documentation. Client behavior remains gated by host-advertised capabilities for interoperability.
  • Regenerate all 19 Copilot prompt baselines for the multi-root create_session tool schema.

Validation

Passed locally on macOS:

  • npm run build-fast -- --client-only
  • npm run typecheck-client
  • git diff --name-only --diff-filter=ACM -z -- '*.ts' | xargs -0 npm run eslint -- — all 16 changed TypeScript files passed; subsequently edited test files were linted again.
  • git diff --check
  • Commit-hook hygiene — passed.

Affected unit suites: 1,326 passed, 1 skipped:

env -u COPILOT_HOME ./scripts/test.sh --reporter dot \
  --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts \
  --run src/vs/platform/agentHost/test/node/claudeAgent.test.ts \
  --run src/vs/platform/agentHost/test/node/codex/codexModelRefresh.test.ts \
  --run src/vs/platform/agentHost/test/node/codex/codexPrewarmEviction.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostUntitledProvisionalSessionService.test.ts

Strict-replay multi-root completion tests: 9 passed:

./scripts/test-integration.sh --reporter dot \
  --run src/vs/platform/agentHost/test/node/e2e/providers/copilotAgentHostE2E.integrationTest.ts \
  --grep 'multi-root file completion|empty multi-root file completion|duplicate basenames in separate roots|duplicate working directory URIs|overlapping roots|non-file roots|colliding root basenames|multi-root relative path query'

Strict-replay lifecycle tests across all three providers, plus Codex secondary-root skill coverage: 7 passed:

./scripts/test-integration.sh --reporter dot \
  --runGlob '**/agentHost/test/node/e2e/providers/{copilot,claude,codex}AgentHostE2E.integrationTest.js' \
  --grep 'workspace lifecycle: peer tools execute in their selected folder|workspace lifecycle: expanding a live session preserves the original chat completion scope|secondary workspace skill reaches the Codex model request'

Complete Copilot prompt suite after regenerating the baselines: 24 passed in strict replay, with no recording or snapshot-update flags:

./scripts/test-integration.sh --reporter dot \
  --run src/vs/platform/agentHost/test/node/e2e/providers/copilotPromptsE2E.integrationTest.ts

After merging current main, client build, type-check, and conflict-resolved test lint passed again. Focused multi-root and session-sync coverage: 7 passed:

env -u COPILOT_HOME ./scripts/test.sh --reporter dot \
  --run src/vs/platform/agentHost/test/node/copilotAgent.test.ts \
  --grep 'multipleWorkingDirectories|additional roots|computeFolderPickerDecision|session.sync|session sync'

The initial build encountered stale installed SDK/runtime versions; npm run install-fast restored matching dependencies. The unit suites require unsetting inherited COPILOT_HOME so their fixtures do not resolve into the developer's real session storage.

Cross-platform Azure validation, the full E2E suite, and real-provider sandbox integration tests have not been run locally.

CI

All current-head GitHub workflows passed: Code OSS, Component Fixtures, CodeQL, Monaco Editor checks, Telemetry, and chat-lib tests. Code OSS covers Windows, Linux, and macOS. Its macOS WebKit unit job passed on a targeted retry after an unrelated chat-pet pixel-equivalence assertion failed; the exact assertion also passed in a focused local WebKit run.

Manual Testing

Open a multi-root workspace and create a new Copilot, Claude, or Codex agent-host session without configuring a multi-root setting. Verify that the session includes the workspace folders and offers file completions and customizations from its selected roots. Verify that a single-folder session continues to use only its selected folder.

(Written by Copilot)

Remove the Copilot, Claude, and Codex multi-root settings and provider gates so all three providers always advertise multiple working directories. Update directory handling, tests, and documentation for unconditional support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 16, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Committed Copilot prompt baselines still expect the old tool schema and must be regenerated and validated.

1 open issue
What changed in this PR

Enables multi-root support by default for Copilot, Claude, and Codex agent-host sessions while retaining capability-based client interoperability.

Changes:

  • Removes experimental multi-root settings and host flags.
  • Uses additional workspace roots without opt-in gates.
  • Updates tests, integration setup, and documentation.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostUntitledProvisionalSessionService.test.ts Updates capability-change comments only.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostUntitledProvisionalSessionService.ts Simplifies the capability-rebinding comment only.
src/​vs/​platform/​agentHost/​test/​node/​providerIntegration/​codexSandbox.integrationTest.ts Removes sandbox test opt-in setup.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​suites/​workingDirectoriesSuite.ts Removes multi-root flag setup and restoration.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​suites/​hostFeaturesSuite.ts Removes completion-test opt-in setup.
src/​vs/​platform/​agentHost/​test/​node/​e2e/​providers/​codexAgentHostE2E.integrationTest.ts Tests secondary-root skills without opt-in.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Updates default capability and root-handling assertions.
src/​vs/​platform/​agentHost/​test/​node/​codex/​codexPrewarmEviction.test.ts Updates workspace-root and single-folder coverage.
src/​vs/​platform/​agentHost/​test/​node/​codex/​codexModelRefresh.test.ts Asserts default multi-root capability.
src/​vs/​platform/​agentHost/​test/​node/​claudeAgent.test.ts Removes opt-in setup and updates capability assertions.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Removes capability, discovery, and folder-picker gates.
src/​vs/​platform/​agentHost/​node/​codex/​codexAgent.ts Removes provider and per-session multi-root flags.
src/​vs/​platform/​agentHost/​node/​claude/​claudeAgent.ts Always advertises capability and enables folder decisions.
src/​vs/​platform/​agentHost/​common/​agentService.ts Removes setting identifiers.
src/​vs/​platform/​agentHost/​common/​agentHostStarter.config.contribution.ts Removes setting registrations.
src/​vs/​platform/​agentHost/​common/​agentHostSchema.ts Removes host configuration keys and schema entries.
src/​vs/​platform/​agentHost/​AGENTS.md Documents unconditional provider support.

Review effort: Balanced

roblourens and others added 2 commits October 16, 2026 15:31
Preserve the upstream session-sync test import while removing the retired multi-root configuration flag.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Regenerate all 19 Copilot model prompt baselines in tokenless replay for the always-enabled multi-root create_session schema. The complete prompt suite passes strict replay with 24 tests.

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

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 9605e15f Current: da7ad97e

Changed (1)

chat/aiCustomizations/aiCustomizationManagementEditor/PluginMarketplaceMigrationDisabled/Light
Before After
before after

@roblourens
roblourens marked this pull request as ready for review October 16, 2026 23:17
@roblourens
roblourens merged commit 1044782 into main Oct 16, 2026
82 of 84 checks passed
@roblourens
roblourens deleted the roblou/agents/enable-agent-host-multi-root-default branch October 16, 2026 23:17
@vs-code-engineering vs-code-engineering Bot added this to the 1.143.0 milestone Oct 16, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

TylerLeonhardt

Matched files:

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants