Skip to content

fix: #3267 preserve required hosted tool IDs in OpenAI conversation sessions#3341

Merged
seratch merged 1 commit intomainfrom
fix/openai-conversation-hosted-tool-ids
May 10, 2026
Merged

fix: #3267 preserve required hosted tool IDs in OpenAI conversation sessions#3341
seratch merged 1 commit intomainfrom
fix/openai-conversation-hosted-tool-ids

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented May 10, 2026

This pull request fixes #3267 OpenAIConversationsSession persistence for hosted tool-call items whose top-level id is required by the Conversations API.

When a Responses run emits items such as file_search_call, the session persistence sanitizer previously stripped id before calling conversations.items.create(), causing the API to reject the saved turn with Missing required parameter: 'items[0].id'. The fix keeps IDs only for Conversations item types that require them, while continuing to strip optional or policy-controlled IDs from messages, function calls, reasoning items, and tool outputs to avoid replaying stale provider IDs.

The change also adds focused regression coverage for required-ID item types, optional-ID item types, provider data stripping, and non-dict passthrough behavior.

@seratch seratch added this to the 0.17.x milestone May 10, 2026
@github-actions github-actions Bot added bug Something isn't working feature:sessions labels May 10, 2026
@seratch
Copy link
Copy Markdown
Member Author

seratch commented May 10, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

ℹ️ 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 merged commit 4bc942a into main May 10, 2026
10 checks passed
@seratch seratch deleted the fix/openai-conversation-hosted-tool-ids branch May 10, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working feature:sessions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAIConversationsSession strips required id from file_search_call before conversations.items.create, causing 400 missing items[0].id

1 participant