Skip to content

agentHost: support file completions across workspace roots - #328944

Merged
DonJayamanne merged 5 commits into
mainfrom
don/agents/multi-root-support-feasibility-study
Aug 4, 2026
Merged

agentHost: support file completions across workspace roots#328944
DonJayamanne merged 5 commits into
mainfrom
don/agents/multi-root-support-feasibility-study

Conversation

@DonJayamanne

@DonJayamanne DonJayamanne commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Summary

For #321651

  • provide agent-host file completions across all effective session and chat working directories
  • collapse nested roots to a minimal enumeration set while preserving logical-root attribution, fair ordering, URI deduplication, and collision labels
  • preserve host ranking and path filtering in both chat surfaces, and avoid incorrect worktree rebasing for nested secondary roots
  • bound ripgrep enumeration concurrency and retain successful results when individual roots fail

Testing

  • npm run typecheck-client
  • npm run valid-layers-check
  • targeted agent-host completion, workspace-file, chat-input, and worktree-rebase unit tests
  • hygiene and diff checks

Here's what it looks like now
image

Enumerate the minimal set of workspace roots, attribute files to their most specific logical root, and preserve fair deterministic completion ordering across chat surfaces. Handle partial root failures, bounded ripgrep concurrency, and worktree rebasing for nested secondary roots.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 4, 2026 11:27

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.

Pull request overview

Extends agent-host file completions across effective session and chat workspace roots.

Changes:

  • Adds multi-root enumeration, deduplication, ranking, and failure isolation.
  • Preserves attachment ownership during worktree rebasing.
  • Adds completion filtering, ordering metadata, documentation, and tests.
Show a summary per file
File Description
chatInputCompletions.test.ts Tests filtering and ordering metadata.
agentHostChatContribution.test.ts Tests nested-root rebasing.
chatInputCompletionUtils.ts Adds resource filter text helper.
agentHostInputCompletionsBase.ts Assigns completion ordering metadata.
agentHostInputCompletions.ts Enables absolute-path filtering.
agentHostSessionHandler.ts Restricts rebasing to the owning root.
SESSIONS.md Documents completion behavior.
sessions/.../agentHostInputCompletions.ts Applies filtering in Agents Window.
agentHostWorkspaceFiles.test.ts Tests caching and nested enumeration.
agentHostFileCompletionUtils.test.ts Tests root planning and attribution.
agentHostFileCompletionProvider.test.ts Covers multi-root provider behavior.
agentService.ts Supplies logging to the provider.
agentHostWorkspaceFiles.ts Limits concurrency and propagates failures.
agentHostFileCompletionUtils.ts Computes logical and enumeration roots.
agentHostFileCompletionProvider.ts Implements multi-root ranking and labels.
agentHostWorkingDirectories.ts Resolves the most-specific owning root.

Review details

  • Files reviewed: 16/16 changed files
  • Comments generated: 4
  • Review effort level: Balanced

Comment thread src/vs/platform/agentHost/node/agentHostFileCompletionProvider.ts Outdated
Comment thread src/vs/platform/agentHost/node/agentHostFileCompletionUtils.ts
Comment thread src/vs/platform/agentHost/node/agentHostWorkspaceFiles.ts Outdated
DonJayamanne and others added 2 commits August 4, 2026 21:36
Rename the helper to describe its deepest-containing-directory semantics and document the behavior at its shared definition.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve host ordering through Monaco filtering, disambiguate duplicate filenames, recover nested roots after truncated enumeration, and start cache expiry only after successful completion. Clarify the completion-root model with focused documentation and regression coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
DonJayamanne and others added 2 commits August 4, 2026 22:13
Qualify duplicate filenames with concise logical-root and relative-path labels while keeping unique filenames basename-only.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@DonJayamanne
DonJayamanne marked this pull request as ready for review August 4, 2026 12:25
@DonJayamanne
DonJayamanne enabled auto-merge (squash) August 4, 2026 12:25
@DonJayamanne
DonJayamanne merged commit e746b00 into main Aug 4, 2026
29 checks passed
@DonJayamanne
DonJayamanne deleted the don/agents/multi-root-support-feasibility-study branch August 4, 2026 14:28
@vs-code-engineering vs-code-engineering Bot added this to the 1.133.0 milestone Aug 4, 2026
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