Copilot Chat: mimo-v2.5 tool-calling loop fails with 400 — not set when tool results contain images
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
## Description
When **mimo-v2.5** (a vision model) is used in a **tool-calling loop**, the request to send tool results back to the model fails with a `400 Bad Request` error. The `text` parameter is missing from the request payload when tool results (particularly those containing image/screenshot content) are sent back to the model.
## Error
```
Request Failed: 400 {"error":{"code":"400","message":"Param Incorrect","param":"`text` is not set","type":""}}
```
**Stack trace:**
```
at jG._provideLanguageModelResponse (vscode/dist/extension.js:1690:14392)
at processTicksAndRejections (node:internal/process/task_queues:20)
at jG.provideLanguageModelResponse (vscode/dist/extension.js:1690:15357)
```
## Reproduction Pattern (from Copilot Chat logs)
The error is **100% reproducible** in the `[ToolCallingLoop]` when `mimo-v2.5` is the model. Here's the exact sequence from the logs:
### Step 1: mimo-v2.5 returns tool_calls (SUCCESS)
```
22:00:47.164 [info] message 0 returned. finish reason: [tool_calls]
22:00:47.169 [info] ccreq:d52943f3.copilotmd | success | mimo-v2.5 | 15768ms
```
### Step 2: Next request with tool results to mimo-v2.5 (FAILS)
```
22:00:48.617 [info] Request ID for failed request: 77ee342b-1e75-4c10-955d-3fe3cb4c5700
22:00:48.618 [error] Server error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"`text` is not set","type":""}}
22:00:48.641 [info] ccreq:f8af3c60.copilotmd | failed | mimo-v2.5 | 1020ms
```
### Step 3: Auto-retry 3 times, all fail (same error)
```
22:00:48.655 [info] [ToolCallingLoop] Auto-retrying on error (attempt 1/3): failed
22:00:50.602 [error] Server error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"`text` is not set","type":""}}
22:00:50.639 [info] [ToolCallingLoop] Auto-retrying on error (attempt 2/3): failed
22:00:52.462 [error] Server error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"`text` is not set","type":""}}
22:00:52.504 [info] [ToolCallingLoop] Auto-retrying on error (attempt 3/3): failed
22:00:54.443 [error] Server error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"`text` is not set","type":""}}
22:00:54.490 [info] [ToolCallingLoop] Stop hook result: shouldContinue=false
```
## Additional Context
- **Model:** `mimo-v2.5` (a vision model)
- **Context:** `[ToolCallingLoop]` with `[copilotLanguageModelWrapper]`
- **Frequency:** The error occurs every time mimo-v2.5 is used in a tool-calling loop where tools return image content
- **No text content:** The request to mimo-v2.5 appears to send tool results with image parts but **no `text` field**, which the API requires
- **Tool limit warnings** also appear before the failure:
```
[warning] [virtual-tools] Had to drop 11 tools due to limit constraints
```
## Request IDs (from failed requests)
- `77ee342b-1e75-4c10-955d-3fe3cb4c5700`
- `1e398d72-2c85-497d-b499-f22ebd458b2c`
- `741b0a76-3cc7-4349-bfaa-f79ee9aeac88`
- `f2ed5c67-942e-445d-91dc-49bc033e8ecd`
- `c2e6d04f-7047-4214-95a0-07c6f1158343`
- `56247f34-6750-486e-9aab-3022b300a898`
- `84da6399-4a20-459a-bd0d-36d87c8e2d8c`
- `73d50213-025d-493a-aa47-7a8b9fed6164`
## Expected Behavior
When a tool returns results (including image content) in the `[ToolCallingLoop]`, the follow-up request to `mimo-v2.5` should include a non-empty `text` field alongside the image content.
## Actual Behavior
The `provideLanguageModelResponse` method constructs the follow-up request with image parts from tool results but omits the required `text` field, causing the API to reject the request with a `400` error.
## Root Cause
The Copilot extension's request builder does not set the `text` parameter when composing a follow-up message to a vision model (`mimo-v2.5`) that only contains tool result content with images and no textual message content.
## Environment
- **OS:** macOS (ARM64)
- **VS Code:** Latest stable
- **Copilot Extension:** Latest
- **Model:** mimo-v2.5 (vision model)
## Relevant Logs
Full logs available at:
`~/Library/Application Support/Code/logs/20260715T220004/window1/exthost/GitHub.copilot-chat/GitHub Copilot Chat.log`
Contributor guide
Assessment
This issue has not been assessed yet.