Skip to content

Prototype full-text and semantic search for agent sessions - #336810

Draft
Bhavya U (bhavyaus) wants to merge 1 commit into
microsoft:mainfrom
bhavyaus:bhavya/session-content-search
Draft

Bhavya U (bhavyaus) wants to merge 1 commit into
microsoft:mainfrom
bhavyaus:bhavya/session-content-search

Conversation

@bhavyaus

Copy link
Copy Markdown
Collaborator

Prototype workspace-scoped conversation search with a shared local index and opt-in semantic search in the editor and Agents windows. Provider history databases remain unchanged.

Validation: 122 focused tests, type checking, and pre-commit hygiene passed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 6771605f-eb93-4b1e-a38f-98af4592e497
Copilot AI balanced review requested due to automatic review settings September 18, 2026 18:11

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.

Copilot review overview

🟡 Changes recommended

New extension hosts miss existing embedding models, and shared Sessions code now depends directly on an Agent Host implementation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds workspace-scoped full-text and opt-in semantic search for persisted Agent Host conversations.

Changes:

  • Adds a shared SQLite FTS/vector search index and Copilot history adapter.
  • Adds local and remote search protocol routes with capability negotiation.
  • Adds search pickers, semantic consent, navigation, accessibility guidance, and tests.
File Description
src/​vs/​workbench/​services/​embeddings/​test/​common/​embeddingsService.test.ts Tests the shared embeddings registry.
src/​vs/​workbench/​services/​embeddings/​common/​embeddingsService.ts Introduces the workbench embeddings service.
src/​vs/​workbench/​services/​agentHost/​browser/​editorRemoteAgentHostServiceClient.ts Proxies remote search operations.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​semanticSessionSearch.test.ts Tests semantic search orchestration.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentHostSessionSearch.test.ts Tests picker, scope, and navigation behavior.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​agentSessions/​agentSessionsActions.test.ts Tests title-only search action placement.
src/​vs/​workbench/​contrib/​chat/​test/​browser/​accessibility/​chatAccessibilityHelp.test.ts Tests updated accessibility guidance.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentSessionsActions.ts Retains title-only search in the palette.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​semanticSessionSearch.ts Implements consent, embedding, and result fusion.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSessionSearch.ts Implements the shared search picker workflow.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHostSessionListStore.ts Extracts workspace matching logic.
src/​vs/​workbench/​contrib/​chat/​browser/​agentSessions/​agentHost/​agentHost.contribution.ts Loads the search contribution.
src/​vs/​workbench/​contrib/​chat/​browser/​actions/​chatAccessibilityHelp.ts Documents search accessibility behavior.
src/​vs/​workbench/​api/​browser/​mainThreadEmbeddings.ts Connects extension providers to the shared registry.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​sessionsActions.test.ts Tests Agents-window action placement.
src/​vs/​sessions/​contrib/​sessions/​browser/​views/​sessionsViewActions.ts Replaces the header action with content search.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sessionsOpenerParticipant.test.ts Tests exact host/chat routing.
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sessionsChatAccessibilityHelp.test.ts Tests Agents-window search help.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsOpenerParticipant.ts Opens exact search-result chats.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionsChatAccessibilityHelp.ts Documents Agents-window search behavior.
src/​vs/​platform/​agentHost/​test/​node/​protocolServerHandler.test.ts Tests remote protocol validation and routing.
src/​vs/​platform/​agentHost/​test/​node/​copilotSessionSearch.test.ts Tests persisted Copilot history indexing.
src/​vs/​platform/​agentHost/​test/​node/​copilotAgent.test.ts Tests Copilot search integration.
src/​vs/​platform/​agentHost/​test/​node/​agentService.test.ts Tests host-level search orchestration.
src/​vs/​platform/​agentHost/​test/​node/​agentHostSessionSearchIndex.test.ts Tests index lifecycle and cleanup.
src/​vs/​platform/​agentHost/​test/​node/​agentHostServices.test.ts Tests search service registration.
src/​vs/​platform/​agentHost/​test/​electron-browser/​agentHostProtocolClient.test.ts Tests client capability negotiation.
src/​vs/​platform/​agentHost/​SESSION_SEARCH.md Documents the prototype architecture.
src/​vs/​platform/​agentHost/​node/​sessionSearchDatabase.ts Implements FTS and vector persistence.
src/​vs/​platform/​agentHost/​node/​protocolServerHandler.ts Handles remote search requests.
src/​vs/​platform/​agentHost/​node/​copilot/​mapSessionEvents.ts Exposes canonical message sanitizers.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotSessionSearch.ts Converts persisted events into documents.
src/​vs/​platform/​agentHost/​node/​copilot/​copilotAgent.ts Connects Copilot history to the index.
src/​vs/​platform/​agentHost/​node/​agentService.ts Orchestrates session and semantic search.
src/​vs/​platform/​agentHost/​node/​agentHostSessionSearchIndex.ts Owns the profile-level search cache.
src/​vs/​platform/​agentHost/​node/​agentHostSessionSearch.ts Routes searches across persisted chats.
src/​vs/​platform/​agentHost/​node/​agentHostServices.ts Registers the search index service.
src/​vs/​platform/​agentHost/​node/​agentHostManagementService.ts Exposes local management search routes.
src/​vs/​platform/​agentHost/​electron-browser/​localAgentHostService.ts Connects local clients to management search.
src/​vs/​platform/​agentHost/​common/​sessionSemanticSearch.ts Defines semantic request contracts.
src/​vs/​platform/​agentHost/​common/​meta/​agentHostSessionSearchMeta.ts Defines search capability metadata.
src/​vs/​platform/​agentHost/​common/​agentService.ts Extends host and connection interfaces.
src/​vs/​platform/​agentHost/​common/​agentHostSessionSearch.ts Defines lexical search contracts.
src/​vs/​platform/​agentHost/​common/​agentHostExtensionProtocol.ts Defines remote extension methods.
src/​vs/​platform/​agentHost/​common/​agent.ts Adds provider history-search support.
src/​vs/​platform/​agentHost/​browser/​agentHostProtocolClient.ts Sends remote search requests.
src/​vs/​platform/​agentHost/​AGENTS.md Documents Agent Host search invariants.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +24 to +26
this._store.add(embeddingsService.onDidChange(() => {
this._proxy.$acceptEmbeddingModels(Array.from(embeddingsService.allProviders));
})));
}));
import { UNIFIED_WORKSPACE_PICKER_SETTING } from '../../../chat/common/constants.js';
import { INewSessionComposerService } from '../../../chat/browser/newSessionComposerService.js';
import { WorkspaceSelectionOrigin } from '../../../../common/workspaceSelection.js';
import { SEARCH_AGENT_SESSION_CONTENT_COMMAND_ID, SEARCH_AGENT_SESSION_CONTENT_TITLE } from '../../../../../workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionSearch.js';
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.

2 participants