fix(core): replay aborted managed tool outputs#1191
fix(core): replay aborted managed tool outputs#1191MukundaKatta wants to merge 2 commits intoopenai:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 6e5df89 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 081a5a386c
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (serverConversationTracker?.conversationId && inputMarked) { | ||
| clearManagedConversationSupplementalItems( | ||
| serverConversationTracker.conversationId, | ||
| ); |
There was a problem hiding this comment.
Clear pending abort outputs on every successful turn
clearManagedConversationSupplementalItems is called only in the streaming path, so abort outputs queued in pendingManagedConversationAbortItems survive successful non-streaming conversationId turns. Because getManagedConversationSupplementalItems always prepends those pending items, a later fresh runner.run(..., { conversationId }) can resend the same synthetic function_call_result again, which can rebalance the transcript incorrectly or trigger duplicate-call errors from the provider. Please clear the queue after successful non-streaming model calls as well.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6e5df89e5d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ProcessedResponse<any>, | ||
| AgentInputItem[] | ||
| >(); | ||
| const pendingManagedConversationAbortItems = new Map<string, AgentInputItem[]>(); |
There was a problem hiding this comment.
Bound pending abort cache to avoid unbounded growth
The new pendingManagedConversationAbortItems cache is a process-global Map keyed by conversationId, but this commit adds no general eviction path for entries that are never replayed successfully. Since queueManagedConversationSupplementalItems keeps inserting IDs and cleanup currently depends on later turn success, aborted conversations that are never resumed can accumulate indefinitely in long-lived workers, causing memory growth over time. Please add a bounded eviction strategy (for example TTL/size cap, and/or broader clear paths) so orphaned conversation IDs do not stay resident forever.
Useful? React with 👍 / 👎.
Summary
Testing