agentHost: enable @ file completions in new and existing sessions#314906
Draft
connor4312 wants to merge 2 commits intomainfrom
Draft
agentHost: enable @ file completions in new and existing sessions#314906connor4312 wants to merge 2 commits intomainfrom
connor4312 wants to merge 2 commits intomainfrom
Conversation
Contributor
Screenshot ChangesBase: Changed (4)Errored (20)Fixtures that failed to render — no screenshot was produced.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables agent-host-backed chat sessions (local and remote) to provide @ file completions by delegating chat input completions to the agent host, rather than relying on the workbench’s in-process completion providers.
Changes:
- Adds a chat input completions delegation API to
IChatSessionsService/content providers and wires agent-host session handlers to implement it. - Introduces Monaco completion providers for agent-host-backed chat inputs (workbench chat widget + Sessions “new chat” input) driven by agent-host-announced trigger characters.
- Implements an agent-host file completion provider backed by cached ripgrep-based workspace file enumeration, and updates the AHP attachment model to a richer
MessageAttachmentKindshape.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/terminal/test/browser/agentHostPty.test.ts | Updates agent-connection mock to support new trigger-character API. |
| src/vs/workbench/contrib/chat/test/common/mockChatSessionsService.ts | Adds mock implementations for chat input completion delegation + trigger characters. |
| src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostChatContribution.test.ts | Updates attachment assertions and adds tests for completion delegation behavior. |
| src/vs/workbench/contrib/chat/common/chatSessionsService.ts | Extends chat session content-provider/service APIs with input completions + trigger characters. |
| src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.ts | Short-circuits built-in providers for agent-host-backed sessions so host delegation wins. |
| src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.ts | Adds workbench chat-input completion provider delegating to agent-host sessions. |
| src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.ts | Implements new completion APIs in the workbench ChatSessionsService. |
| src/vs/workbench/contrib/chat/browser/chat.contribution.ts | Registers the new agent-host input completions contribution. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/loggingAgentConnection.ts | Updates logging wrapper for cancellable completions + trigger-character method. |
| src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts | Implements chat input completions + trigger chars via agent-host protocol; updates attachment mapping. |
| src/vs/sessions/contrib/chat/browser/newChatInput.ts | Wires agent-host completion handler into the Sessions “new chat” input editor. |
| src/vs/sessions/contrib/chat/browser/agentHostInputCompletions.ts | Adds Sessions-specific input completion handler + decoration/attachment bridging. |
| src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts | Updates agent-service mock for new trigger-character API. |
| src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts | Updates tests for new internal attachment kind enum. |
| src/vs/platform/agentHost/test/node/agentSideEffects.test.ts | Updates tests for new protocol attachment shape + mapping to agent attachments. |
| src/vs/platform/agentHost/test/node/agentHostWorkspaceFiles.test.ts | Adds coverage for ripgrep-backed workspace file enumeration + caching/cancellation. |
| src/vs/platform/agentHost/test/node/agentHostFileCompletionProvider.test.ts | Adds coverage for @ token extraction and file completion ranking/limits. |
| src/vs/platform/agentHost/node/protocolServerHandler.ts | Extends initialize response config to include completion trigger characters. |
| src/vs/platform/agentHost/node/agentSideEffects.ts | Maps protocol MessageAttachment to internal agent attachment representation. |
| src/vs/platform/agentHost/node/agentService.ts | Wires built-in file completion provider + exposes trigger characters + cancellable completions. |
| src/vs/platform/agentHost/node/agentHostWorkspaceFiles.ts | Implements cached ripgrep --files enumeration for workspace files. |
| src/vs/platform/agentHost/node/agentHostServerMain.ts | Supplies completion trigger characters to protocol server config. |
| src/vs/platform/agentHost/node/agentHostMain.ts | Supplies completion trigger characters to protocol server config (local + WS). |
| src/vs/platform/agentHost/node/agentHostFileCompletionProvider.ts | Implements fuzzy-ranked @ file completion provider using cached workspace enumeration. |
| src/vs/platform/agentHost/node/agentHostCompletions.ts | Adds trigger-character aggregation across completion providers. |
| src/vs/platform/agentHost/electron-browser/agentHostService.ts | Updates IPC client for cancellable completions + trigger-character retrieval. |
| src/vs/platform/agentHost/common/state/sessionState.ts | Re-exports updated attachment-related protocol types/enums. |
| src/vs/platform/agentHost/common/state/protocol/state.ts | Reworks attachment model into MessageAttachmentKind union with richer fields. |
| src/vs/platform/agentHost/common/state/protocol/.ahp-version | Bumps the protocol version hash. |
| src/vs/platform/agentHost/common/agentService.ts | Updates public agent-host interfaces for cancellable completions + trigger chars + attachment kind enum. |
| src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.ts | Captures trigger chars from initialize handshake; updates completions signature. |
| src/vs/platform/agentHost/browser/nullAgentHostService.ts | Updates null implementation for new completions signature + trigger-char method. |
Copilot's findings
- Files reviewed: 32/32 changed files
- Comments generated: 2
fde1f33 to
5788cd3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.