Skip to content

fix(providers/openai): fix Responses replay continuity#31

Draft
ibetitsmike wants to merge 2 commits intocoder_2_33from
mike/openai-responses-continuity
Draft

fix(providers/openai): fix Responses replay continuity#31
ibetitsmike wants to merge 2 commits intocoder_2_33from
mike/openai-responses-continuity

Conversation

@ibetitsmike
Copy link
Copy Markdown

@ibetitsmike ibetitsmike commented Apr 25, 2026

Worked on by Mux on Mike's behalf.

Summary

  • Replay stored reasoning items as item_reference when store=true and a persisted reasoning item ID is available.
  • Replay provider-executed web search item references only when they immediately follow a replayed reasoning reference, otherwise skip them instead of sending a bare ws_* item.
  • Validate explicit Responses replay before send so local function_call items pair with exactly one later function_call_output, and ws_* item references have a preceding rs_* reference.
  • Add contract tests for reasoning plus web search replay, missing reasoning metadata, store=false replay, and malformed function-call ordering.

Tests

  • go test ./providers/openai -run 'TestResponsesToPrompt_(ReasoningWithStore|ReasoningWithWebSearchCombined|WebSearchRequiresReasoningReference|ReasoningWithFunctionCallCombined|WebSearchProviderExecutedToolResults)|TestPrepareParams_(SkipsProviderExecutedToolReferences|ValidatesFunctionCallOutputPairing)|TestValidateResponsesInput_WebSearchReferenceRequiresReasoning' -count=1
  • go test ./providers/openai -count=1
  • git diff --check

> Worked on by Mux on Mike's behalf.
@ibetitsmike
Copy link
Copy Markdown
Author

/coder-agents-review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant