[prompts]: add support for 'mode' header metadata #247079
Merged
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.
Adds support for the
modeheader metadata that defines what chat mode to use when a prompt in run in the chat widget. Currently:modecan be one of 3 string values:'ask','edit', or'agent'toolsmetadata is defined thenmodeis assumed to beagentand any other configured value is ignored and is highlighted with appropriate warning marker in the editorchat modevalue for the entire prompt tree; this has couple of consequences:agentmode, while some nested prompt definestools, the tools metadata gets ignoredchat modeandtoolsmetadata is computed across all of them; for instance, if there are multiple prompt files attached and each of them define it's ownmode, we compute the safest possible mode that will satisfy all of them, where theAskmode is the safest whileAgentis the least safesttools, those are computed as a union of alltoolsthat the prompt files definePart 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