fix: avoid stream:false error in CodexMessageAdapter.generateResponse#511
fix: avoid stream:false error in CodexMessageAdapter.generateResponse#511
Conversation
📝 WalkthroughWalkthroughThe CodexMessageAdapter has been refactored to use Server-Sent Events (SSE) streaming instead of non-streaming JSON POST responses. Response objects are now assembled incrementally from streaming chunks via a new helper function that manages progressive state transitions. Final response construction extracts id, created_at, and model from the accumulated streaming payload. Changes
Sequence DiagramsequenceDiagram
participant Adapter as CodexMessageAdapter
participant SSE as SSE Stream
participant Accumulate as accumulateResponseSnapshot
participant Response as Response Object
Adapter->>SSE: POST with stream: true
Note over SSE: Streaming begins
loop For each SSE event
SSE->>Accumulate: Send ResponseStreamEvent
activate Accumulate
Accumulate->>Response: Mutate snapshot with delta/added
Note over Accumulate: Handle output_item, content_part,<br/>output_text, function_call,<br/>reasoning events
Accumulate-->>SSE: Updated snapshot
deactivate Accumulate
end
Note over Response: Extract id, created_at, model,<br/>reasoning, tool_calls from<br/>accumulated payload
SSE->>Adapter: Stream complete
Adapter->>Response: Finalize response
Adapter-->>Adapter: Return assembled Response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
Avoid
stream:falsein CodexMessageAdapter.generateResponse since Codex endpoint always requiresstream:true.Checklist before requesting a review
npm run lint:checkandnpm run type:check)npm run test)Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.