Skip to content

feat: #1097 support overrideArguments for approved tool calls#1098

Open
seratch wants to merge 3 commits intomainfrom
feat/approval-override-arguments
Open

feat: #1097 support overrideArguments for approved tool calls#1098
seratch wants to merge 3 commits intomainfrom
feat/approval-override-arguments

Conversation

@seratch
Copy link
Member

@seratch seratch commented Mar 14, 2026

This pull request resolves #1097.

It adds overrideArguments support to RunState.approve(...) so human approval flows can correct a pending function_call before execution and resume with the corrected arguments. The runner and RunState now propagate those overrides through resumed execution, replay input, tracing, and serialized state so the approved tool call behaves consistently across interruption and resume boundaries.

To support durable local replay, this change also adds session-history rewrite support for local sessions, including a new OpenAIResponsesHistoryRewriteSession and shared rewrite-aware session interfaces/exports. That allows corrected function-call arguments to become the canonical persisted history for local memory/file-backed flows, while saveOverrideArguments remains an opt-out for execution-only overrides in server-managed conversation paths where persisted history cannot be rewritten. Examples and tests were updated to cover local persistence, compaction ordering, public exports, and the conversation/previous-response edge cases around override handling.

@changeset-bot
Copy link

changeset-bot bot commented Mar 14, 2026

🦋 Changeset detected

Latest commit: d0cb8cf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents Patch
@openai/agents-core Patch
@openai/agents-openai Patch
@openai/agents-extensions Patch
@openai/agents-realtime Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seratch seratch changed the title feat: #1097 support overrideArguments for approved tool calls feat: #1097 support overrideArguments for approved tool calls Mar 14, 2026
@github-actions github-actions bot added this to the 0.7.x milestone Mar 14, 2026
@seratch
Copy link
Member Author

seratch commented Mar 14, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

const serverManagesConversation =
Boolean(effectiveOptions.conversationId ?? resumedConversationId) ||
Boolean(effectiveOptions.previousResponseId ?? resumedPreviousResponseId);

P2 Badge Detect server-managed sessions before blocking exec-only overrides

serverManagesConversation is computed only from conversationId/previousResponseId. Resumes using OpenAIConversationsSession usually have neither, so execution-only overrides (saveOverrideArguments: false) are rejected even though the transcript is server-managed and non-rewriteable. This blocks the intended fallback path for conversations-backed runs.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch seratch force-pushed the feat/approval-override-arguments branch from b987d9c to cea8656 Compare March 15, 2026 00:17
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cea8656ac9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@seratch seratch force-pushed the feat/approval-override-arguments branch from cea8656 to d0cb8cf Compare March 15, 2026 11:18
@seratch seratch marked this pull request as ready for review March 15, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: approve() with modified arguments

1 participant