Skip to content

prompt service: cache ISlashCommandDiscoveryInfo and IAgentDiscoveryInfo#306144

Merged
aeschli merged 4 commits intomainfrom
aeschli/cooing-porpoise-986
Mar 31, 2026
Merged

prompt service: cache ISlashCommandDiscoveryInfo and IAgentDiscoveryInfo#306144
aeschli merged 4 commits intomainfrom
aeschli/cooing-porpoise-986

Conversation

@aeschli
Copy link
Copy Markdown
Contributor

@aeschli aeschli commented Mar 29, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 29, 2026 19:35
@aeschli aeschli enabled auto-merge (squash) March 29, 2026 19:35
@aeschli aeschli self-assigned this Mar 29, 2026
@vs-code-engineering vs-code-engineering bot added this to the Backlog milestone Mar 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the chat prompt service caching strategy to cache discovery info objects (for agents, slash commands, and skills) rather than caching only the derived arrays, so discovery details can be reused without recomputation.

Changes:

  • Cache ISlashCommandDiscoveryInfo and derive IChatPromptSlashCommand[] from it.
  • Cache IAgentDiscoveryInfo and derive ICustomAgent[] from it.
  • Cache IPromptDiscoveryInfo for skills while keeping telemetry emission in the discovery computation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts Switches caches to store discovery info and derives agents/commands/skills from those cached results.
src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.ts Adds new discovery interfaces that embed parsed/resolved objects for slash commands and agents.
Comments suppressed due to low confidence (1)

src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.ts:739

  • onDidLogDiscovery is fired with discoveryInfo that now contains full ICustomAgent objects (including instructions content). The debug bridge stores discoveryInfo for later resolution and only needs file-level metadata; keeping full agent objects there can significantly increase memory usage and retain potentially sensitive prompt/instructions text. Suggest emitting a sanitized/lightweight IPromptDiscoveryInfo for logging (no agent payload), while still caching full agents for getCustomAgents().
			this._onDidLogDiscovery.fire({
				sessionResource,
				name: localize("promptsService.loadAgents", "Load Agents"),
				details,
				discoveryInfo,
				category: 'discovery',
			});

…ptsServiceImpl.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@aeschli aeschli marked this pull request as ready for review March 31, 2026 11:03
@aeschli aeschli enabled auto-merge (squash) March 31, 2026 11:44
@aeschli aeschli merged commit d10d2b4 into main Mar 31, 2026
18 checks passed
@aeschli aeschli deleted the aeschli/cooing-porpoise-986 branch March 31, 2026 12:08
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