kimi-code/packages/agent-core/test/loop
Kai 933cf6727e
fix(agent-core): surface user interruptions to the model instead of a neutral abort (#236)
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.
2026-05-30 09:53:21 +08:00
..
fixtures feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00
abort.e2e.test.ts fix(agent-core): surface user interruptions to the model instead of a neutral abort (#236) 2026-05-30 09:53:21 +08:00
api-shape.e2e.test.ts feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00
error-paths.e2e.test.ts refactor(agent-core): slim llm request log line (#190) 2026-05-29 13:36:34 +08:00
events.e2e.test.ts feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00
hooks.e2e.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
retry.test.ts fix(kosong): retry when a response stream is terminated mid-flight (#201) 2026-05-29 15:18:55 +08:00
streaming.e2e.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
tool-call.e2e.test.ts feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00
tool-scheduler.test.ts feat: rework permission decision policies (#26) 2026-05-27 20:07:24 +08:00
transcript.e2e.test.ts Kimi For Coding 2026-05-22 15:54:50 +08:00
turn-lifecycle.e2e.test.ts feat: remove default per-turn step limit of 1000 (#186) 2026-05-29 13:11:45 +08:00