Skip to content

Conversation

@legomushroom
Copy link
Member

Adds support for the mode header metadata that defines what chat mode to use when a prompt in run in the chat widget. Currently:

  • mode can be one of 3 string values: 'ask', 'edit', or 'agent'
  • if tools metadata is defined then mode is assumed to be agent and any other configured value is ignored and is highlighted with appropriate warning marker in the editor
  • likewise, if a prompt file references for other prompt files, the top level prompt file defines overall chat mode value for the entire prompt tree; this has couple of consequences:
    • if a nested prompt file defines a different mode, it gets ignored
    • if a top-level prompt file does not use agent mode, while some nested prompt defines tools, the tools metadata gets ignored
  • furthermore, if multiple prompts are attached at the same time, the overall chat mode and tools metadata is computed across all of them; for instance, if there are multiple prompt files attached and each of them define it's own mode, we compute the safest possible mode that will satisfy all of them, where the Ask mode is the safest while Agent is the least safest
  • as for the overall tools, those are computed as a union of all tools that the prompt files define

Part of https://github.com/microsoft/vscode-copilot/issues/15596, https://github.com/microsoft/vscode-copilot/issues/15420 and https://github.com/microsoft/vscode-copilot/issues/12203

@legomushroom legomushroom added this to the April 2025 milestone Apr 21, 2025
@legomushroom legomushroom self-assigned this Apr 21, 2025
@legomushroom legomushroom force-pushed the legomushroom/prompts/mode-header-metadata branch from b1b728d to 7acb8e1 Compare April 21, 2025 21:11
@legomushroom legomushroom marked this pull request as ready for review April 21, 2025 21:28
@legomushroom legomushroom merged commit 52592e3 into main Apr 21, 2025
8 checks passed
@legomushroom legomushroom deleted the legomushroom/prompts/mode-header-metadata branch April 21, 2025 23:05
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jun 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants