fix(coding-agent): document mutable tool_call input closes #2611
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user