[BUG]: "Operation cancelled by user" is re-injected as a user message after cancelling a turn
- 主要语言
- Shell
- 星标
- 11.2k
- 派生
- 1.9k
- 平均合并
- 14 小时 16 分钟
- 30 天内合并 PR
- 6
描述
Type rg --version### What happened?
When I cancel an in-progress turn (Esc / Ctrl-C), the line `Operation cancelled by user` is sent back to the model as if it were a new **user message** (it arrives with its own fresh timestamp). The agent then "replies" to it as though it were a real instruction/content, instead of the cancel simply aborting the current operation silently.
This produces phantom turns: every cancel results in the assistant responding to nothing.
### Expected behavior
Cancelling a turn should abort the current operation and return to the prompt without injecting `Operation cancelled by user` into the conversation as a user turn. The model should not be prompted to respond to it.
### Steps to reproduce
1. Send a prompt that triggers tool calls / a longer operation.
2. Cancel mid-operation (Esc / Ctrl-C).
3. Observe `Operation cancelled by user` appears as a user message with a new timestamp, and the assistant generates a reply addressed to it.
### Notes
- Reported as a regression — a user observed this did not happen in earlier versions.
- Likely related to (but distinct from) the closed #2502 "Stuck in \"Cancelling\" after operation cancelled by user".
- Behavior is client-side and version-dependent, not account- or repo-specific.
### Version
1.0.63
### OS
macOS (Darwin)
贡献指南
调研方向
Start at the client-side cancellation path for Esc/Ctrl-C and search for the exact text `Operation cancelled by user`. Trace how cancellation output becomes a user message, then verify that cancelling returns to the prompt without creating a user turn or triggering an assistant response.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- shell
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100