fix(core): send shell output to model on cancel (#20501)

This commit is contained in:
Dev Randalpura
2026-03-03 14:10:16 -08:00
committed by GitHub
parent 28e79831ac
commit f3bbe6e77a
8 changed files with 315 additions and 103 deletions

View File

@@ -9,13 +9,30 @@ import { isTool } from '../index.js';
import { SHELL_TOOL_NAMES } from './shell-utils.js';
import levenshtein from 'fast-levenshtein';
import { ApprovalMode } from '../policy/types.js';
import { CoreToolCallStatus } from '../scheduler/types.js';
import {
CoreToolCallStatus,
type ToolCallResponseInfo,
} from '../scheduler/types.js';
import {
ASK_USER_DISPLAY_NAME,
WRITE_FILE_DISPLAY_NAME,
EDIT_DISPLAY_NAME,
} from '../tools/tool-names.js';
/**
* Validates if an object is a ToolCallResponseInfo.
*/
export function isToolCallResponseInfo(
data: unknown,
): data is ToolCallResponseInfo {
return (
typeof data === 'object' &&
data !== null &&
'callId' in data &&
'responseParts' in data
);
}
/**
* Options for determining if a tool call should be hidden in the CLI history.
*/