Problem
When a user wants to approve a tool call but first edit the arguments (e.g. changing an email recipient, or doing a minor re-wording of some text), there's no way to express this through the approve() API.
Currently, expressing "yes, run this tool, but with these args" requires consumers to:
- Intercept tool execution to swap in the edited args (since
execute receives the original ones)
- Rewrite the LLM's history via
callModelInputFilter so the model sees the correct arguments
Proposal
Add an optional newArguments override to approve():
approve(approvalItem, options?: {
alwaysApprove?: boolean;
newArguments?: Record<string, unknown>;
}): void;
When newArguments is provided, the SDK would:
- Execute the tool with the overridden arguments
- Record the updated arguments in the run history (so the LLM sees the correct values)
This mirrors how reject() already accepts a custom message to control what the model sees.
Problem
When a user wants to approve a tool call but first edit the arguments (e.g. changing an email recipient, or doing a minor re-wording of some text), there's no way to express this through the
approve()API.Currently, expressing "yes, run this tool, but with these args" requires consumers to:
executereceives the original ones)callModelInputFilterso the model sees the correct argumentsProposal
Add an optional
newArgumentsoverride toapprove():When
newArgumentsis provided, the SDK would:This mirrors how
reject()already accepts a custommessageto control what the model sees.