fix(coding-agent): document mutable tool_call input closes #2611

This commit is contained in:
Mario Zechner
2026-03-27 04:01:20 +01:00
parent f456a7a4db
commit 7fe7081745
3 changed files with 80 additions and 2 deletions

View File

@@ -717,7 +717,12 @@ export interface CustomToolCallEvent extends ToolCallEventBase {
input: Record<string, unknown>;
}
/** Fired before a tool executes. Can block. */
/**
* Fired before a tool executes. Can block.
*
* `event.input` is mutable. Mutate it in place to patch tool arguments before execution.
* Later `tool_call` handlers see earlier mutations. No re-validation is performed after mutation.
*/
export type ToolCallEvent =
| BashToolCallEvent
| ReadToolCallEvent
@@ -879,6 +884,7 @@ export interface ContextEventResult {
export type BeforeProviderRequestEventResult = unknown;
export interface ToolCallEventResult {
/** Block tool execution. To modify arguments, mutate `event.input` in place instead. */
block?: boolean;
reason?: string;
}