Skip to content

Feature: approve() with modified arguments #1097

@KostaGPT

Description

@KostaGPT

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:

  1. Intercept tool execution to swap in the edited args (since execute receives the original ones)
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions