MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / abortedToolOutput

Function abortedToolOutput

packages/agent-core/src/loop/tool-call.ts:57–62  ·  view source on GitHub ↗

* Output for an aborted tool call. When the abort carries a user-cancellation * reason (the user pressed stop), say so explicitly so the model treats it as a * deliberate interruption instead of a system fault to theorise about or retry. * Any other abort keeps the neutral wording.

(toolName: string, signal: AbortSignal)

Source from the content-addressed store, hash-verified

55 * Any other abort keeps the neutral wording.
56 */
57function abortedToolOutput(toolName: string, signal: AbortSignal): string {
58 if (isUserCancellation(signal.reason)) {
59 return `The user manually interrupted "${toolName}" (and anything else running at the same time). This was a deliberate user action, not a system error, timeout, or capacity limit. Do not retry automatically or guess at the cause — wait for the user's next instruction.`;
60 }
61 return `Tool "${toolName}" was aborted`;
62}
63
64export interface ToolCallStepContext {
65 readonly tools?: readonly ExecutableTool[] | undefined;

Callers 2

settleAbortedFunction · 0.85
runRunnableToolCallFunction · 0.85

Calls 1

isUserCancellationFunction · 0.90

Tested by

no test coverage detected