mirror of
https://github.com/MoonshotAI/kimi-code.git
synced 2026-07-18 05:34:23 +00:00
When the user interrupts running tools or parallel subagents, the tool_result fed back to the model was a neutral `Tool "X" was aborted` or a weak "stopped by the user", so the model treated it as a system fault and speculated about capacity/concurrency limits instead of recognizing a deliberate stop. Carry a UserCancellationError as the AbortSignal reason from the cancel sites (Turn.cancel/abortTurn, SessionSubagentHost.cancelAll) through to the message sites (tool-call settle paths and the AgentTool catches), which now emit an explicit "deliberate user action, not a system error/timeout/capacity limit" message. Aborts propagated from another signal (e.g. a subagent's deadline via waitForCurrentTurn) carry their original reason, so a timeout is not mislabeled as a user interruption. The telemetry outcome classifier matches the new "manually interrupted" phrase to keep counting these as cancelled. |
||
|---|---|---|
| .. | ||
| fixtures | ||
| abort.e2e.test.ts | ||
| api-shape.e2e.test.ts | ||
| error-paths.e2e.test.ts | ||
| events.e2e.test.ts | ||
| hooks.e2e.test.ts | ||
| retry.test.ts | ||
| streaming.e2e.test.ts | ||
| tool-call.e2e.test.ts | ||
| tool-scheduler.test.ts | ||
| transcript.e2e.test.ts | ||
| turn-lifecycle.e2e.test.ts | ||