Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: fix OpenAI reasoning + web_search replay failure - #23402

Closed
ibetitsmike wants to merge 4 commits into
mainfrom
mike/fix-openai-reasoning-websearch-replay
Closed

fix: fix OpenAI reasoning + web_search replay failure#23402
ibetitsmike wants to merge 4 commits into
mainfrom
mike/fix-openai-reasoning-websearch-replay

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Mar 21, 2026

Copy link
Copy Markdown
Collaborator

Fixes the follow-up turn failure when an OpenAI reasoning model produces both reasoning output and a provider-executed web_search_call in the same response.

Root cause: The fantasy adapter skipped reasoning items entirely during replay. When store=true, web_search items were replayed via item_reference but the reasoning item that preceded them was dropped. OpenAI rejects this with: "reasoning was provided without its required following item."

Fix: Updated the pinned fantasy fork to emit item_reference for reasoning items when store=true, keeping them paired with subsequent provider-executed tool calls. Upstream PR: coder/fantasy#7

Changes

  • coderd/chatd/chattest/openai.go: Extended fake OpenAI server to stream reasoning + web_search + text events
  • coderd/chatd/integration_test.go: Added TestOpenAIReasoningWithWebSearchRoundTrip and TestOpenAIReasoningWithWebSearchRoundTripStoreFalse
  • go.mod/go.sum: Updated fantasy pin to include the replay fix

@ibetitsmike ibetitsmike changed the title fix(coderd/chatd): fix OpenAI reasoning + web_search replay failure fix: fix OpenAI reasoning + web_search replay failure Mar 21, 2026
@ibetitsmike

Copy link
Copy Markdown
Collaborator Author

@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".

@ibetitsmike
ibetitsmike marked this pull request as ready for review March 23, 2026 11:06
@github-actions github-actions Bot added the stale This issue is like stale bread. label Apr 1, 2026
@kylecarbs kylecarbs closed this Apr 2, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants