microsoft / microsoft/vscode

Queued prompt submitted twice (duplicate user message) in Copilot Chat agent sessions

Open
#330,713 0 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

### Summary

When prompts are **queued** in a Copilot Chat **agent session** (typed while the agent is still working on the current turn), a queued prompt is sometimes **submitted twice** — the identical user message is processed as **two consecutive turns**. The agent answers the request, and then immediately receives and processes the exact same prompt again.

This is a third distinct failure mode of queued-prompt handling in the agent host / Copilot CLI runtime, alongside the already-reported #317129 (queued message *disappears*) and #327649 (queued prompts *merged*). This one is **duplication**.

### Does this issue occur when all extensions are disabled?

N/A — the affected surface is Copilot Chat / the agent-session (Copilot CLI) runtime itself, which cannot be disabled to reproduce.

### Version

```
VS Code: 1.133.0
OS: WSL2 (Ubuntu 24.04.3 LTS) on Windows 10
Runtime: Copilot CLI runtime in VS Code (agent session / "agent host")
```

### Steps to Reproduce

1. Start an **agent session** (Copilot CLI runtime) and give it a task that takes a while (multiple tool calls).
2. **While the agent is still working**, type a follow-up prompt and press Enter so it is **queued** (repeat once or twice to build up a small queue).
3. Let the agent finish the current turn and pick up the queued prompt(s).

### Expected

Each queued prompt is delivered **exactly once**, as its own turn, in order.

### Actual

Intermittently, a queued prompt is delivered **twice**: the agent completes the request, then the **identical** user message arrives again as the next turn and is processed a second time. Observed roughly 6 times across a single long, queue-heavy session (i.e. intermittent, but common when queuing is used heavily).

Additional observed detail: in a couple of instances the **second (duplicate) copy carried different/broken attachment metadata** than the first — specifically a failed tagged-file reference of the form:

```
vscode-agent-host://wsl__ubuntu/.../Pasted%20Image.png (error: ENOENT ... 'vscode-agent-host://wsl__ubuntu/...')
```

Note the `wsl__ubuntu` (double-underscore) authority in that failed reference. This suggests the duplicate is a **separate re-delivery** of the queued prompt (the payload is re-resolved), not merely a UI echo — and that the re-delivery path mangles the remote authority (`wsl__ubuntu` instead of `wsl+ubuntu`). This may be related to the WSL remote authority handling seen in the agent-host "Open in VS Code" flow.

### Impact

- The agent redoes work it already completed (wasted tokens / tool calls, and potential double side effects if the prompt caused a mutation like a file edit, commit, or API call).
- Agents have to defensively detect "the previous message repeated verbatim" and no-op, which is unreliable and shouldn't be necessary.

### Related issues

- #317129 — Queued messages disappear for Copilot CLI (agent host)
- #327649 — Queued GitHub Copilot commands merged and use wrong model
- #330521, #326123 — queued-prompt feature requests

These all point at the queued-prompt dispatch path in the agent host; the duplication behavior here appears to be another edge case of the same mechanism.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.