microsoft / microsoft/vscode-docs

Document that, for the copilot models, the final prompt must end with a non-tool-result `UserMessage`

Open
#8,063 1 comment 0 reactions 1 assignee View on GitHub

@ntrogh is already working on this.

Since Feb 24, 2025.

doc-bug
Dominant language
Markdown
Stars
6.6k
Forks
5.8k
Avg merge
11h 43m
Merged PRs (30d)
123

Description

When implementing a chat participant that uses tool calls with the copilot models, the last message sent to the copilot models after invoking a tool should not be the result of the tool call. A prompt like "Above is the result of calling one or more tools. The user cannot see the results, so you should explain them to the user if referencing them in your answer" is required after the tool call result. This behavior differs from that of the OpenAI Chat API.

Since this is only written as a comment in the chat-sample, it should also be included in the documentation.

See https://github.com/microsoft/vscode-extension-samples/blob/7e4846a7a78428c52e8fe7f7aae16aa444f8d8cb/chat-sample/src/toolsPrompt.tsx#L83-L87

		// Note- for the copilot models, the final prompt must end with a non-tool-result UserMessage
		return <>
			{this.props.toolCallRounds.map(round => this.renderOneToolCallRound(round))}
			<UserMessage>Above is the result of calling one or more tools. The user cannot see the results, so you should explain them to the user if referencing them in your answer.</UserMessage>
		</>;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.