MCP sampling/createMessage response includes system prompt text in content
- Linguagem predominante
- Shell
- Estrelas
- 11.2k
- Forks
- 1.9k
- Merge médio
- 14h 16min
- PRs com merge (30d)
- 6
Descrição
### Describe the bug
When an MCP server sends a `sampling/createMessage` request, the Copilot CLI correctly routes it to the LLM and returns a response. However, the response content prepends the entire system prompt text before the LLM's actual answer.
### Affected version
GitHub Copilot CLI 1.0.16-0
### Steps to reproduce the behavior
1. Configure an MCP server that uses `sampling/createMessage` with a system prompt
2. Have the server send a sampling request where it expects a specific response format
3. Approve the sampling request when prompted
4. Observe the response content includes the system prompt prepended to the LLM's answer
### Expected behavior
The `CreateMessageResult.Content` should contain only the LLM's response text, e.g.:
```
=== FALSE
```
### Additional context
## Actual behavior
The response content contains the system prompt echoed back, followed by the LLM's answer:
```
... === FALSE
```
## Note
This works correctly in VS Code's MCP sampling implementation — the system prompt is not included in the response content.
Guia de contribuição
Direção de pesquisa
Start by reproducing an MCP server's sampling/createMessage request with a system prompt, then inspect the returned CreateMessageResult.Content. Compare the CLI result with VS Code's MCP sampling behavior; done means the content contains only the LLM response, without the system prompt text.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- shell, vscode
- Domínio
- ai, cli
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Pouca atividade
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 52/100