Skip to content

fix: avoid replaying assistant conversation item IDs#1235

Merged
seratch merged 4 commits intomainfrom
fix/conversation-assistant-replay-metadata
May 5, 2026
Merged

fix: avoid replaying assistant conversation item IDs#1235
seratch merged 4 commits intomainfrom
fix/conversation-assistant-replay-metadata

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented May 5, 2026

This pull request fixes OpenAI Conversations session replay by stripping provider-managed assistant message metadata from stored history only when that history is sent back to the model. Replaying assistant Conversation item IDs can interfere with server-managed conversation history, while user IDs and tool call/tool output IDs still need to be preserved.

The change adds an optional session hook in @openai/agents-core for model-input-only history rewriting, implements it in OpenAIConversationsSession, and adds regression coverage for assistant-only sanitization, callback matching, regular session preservation, user ID distinction, and tool linkage preservation.

see also: openai/openai-agents-python#3127

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 5, 2026

🦋 Changeset detected

Latest commit: bdbfaef

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-core Patch
@openai/agents-openai Patch
@openai/agents-extensions Patch
@openai/agents-realtime Patch
@openai/agents 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 marked this pull request as draft May 5, 2026 12:04
@github-actions github-actions Bot added this to the 0.8.x milestone May 5, 2026
@seratch seratch modified the milestones: 0.8.x, 0.9.x May 5, 2026
@seratch seratch marked this pull request as ready for review May 5, 2026 15:01
@seratch seratch merged commit 06f425a into main May 5, 2026
7 checks passed
@seratch seratch deleted the fix/conversation-assistant-replay-metadata branch May 5, 2026 15:34
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.

1 participant