feat: #1097 support overrideArguments for approved tool calls#1098
feat: #1097 support overrideArguments for approved tool calls#1098
Conversation
🦋 Changeset detectedLatest commit: d0cb8cf The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
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 |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
openai-agents-js/packages/agents-core/src/run.ts
Lines 528 to 530 in b987d9c
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".
packages/agents-openai/src/memory/openaiResponsesCompactionSession.ts
Outdated
Show resolved
Hide resolved
b987d9c to
cea8656
Compare
There was a problem hiding this comment.
💡 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".
packages/agents-openai/src/memory/openaiResponsesCompactionSession.ts
Outdated
Show resolved
Hide resolved
cea8656 to
d0cb8cf
Compare
This pull request resolves #1097.
It adds
overrideArgumentssupport toRunState.approve(...)so human approval flows can correct a pendingfunction_callbefore execution and resume with the corrected arguments. The runner andRunStatenow 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
OpenAIResponsesHistoryRewriteSessionand shared rewrite-aware session interfaces/exports. That allows corrected function-call arguments to become the canonical persisted history for local memory/file-backed flows, whilesaveOverrideArgumentsremains 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.