-
Notifications
You must be signed in to change notification settings - Fork 666
Feature: approve() with modified arguments #1097
Copy link
Copy link
Open
Labels
Milestone
Description
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
executereceives the original ones) - Rewrite the LLM's history via
callModelInputFilterso 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.
Reactions are currently unavailable