Codex backend streams final answer as a single huge response.output_text.delta instead of incremental text deltas
What version of Codex CLI is running?
0.141.0
What subscription do you have?
Codex backend streams final answer as a single huge response.output_text.delta instead of incremental text deltas
Which model were you using?
gpt-5.5
What platform is your computer?
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 unknown
What terminal emulator and version are you using (if applicable)?
_No response_
Codex doctor report
not available
What issue are you seeing?
What issue are you seeing?
When calling the Codex backend responses endpoint with stream: true, the connection is clearly an SSE stream and emits events such as response.in_progress, keepalive, and response.reasoning_summary_text.delta.
However, the final user-visible answer is not streamed incrementally. Even for a long output request of ~6k output tokens, the backend emits exactly one very large response.output_text.delta containing the entire final answer, immediately followed by response.output_text.done, response.content_part.done, response.output_item.done, and response.completed.
This makes the user-visible behavior effectively non-streaming.
Endpoint
https://chatgpt.com/backend-api/codex/responses
Model
gpt-5.5
Request shape
curl -N https://chatgpt.com/backend-api/codex/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.5",
"store": false,
"stream": true,
"max_output_tokens": 6000,
"text": {
"format": { "type": "text" },
"verbosity": "high"
},
"reasoning": {
"effort": "minimal"
},
"tool_choice": "none",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "You are testing streaming behavior. Write a long, detailed report of at least 3500 words. Begin immediately. Use exactly 12 sections. Each section must start with STREAM_TEST_SECTION_N."
}
]
}
]
}'
Observed behavior
The stream emits multiple keepalive events, then emits one final answer delta containing the entire answer:
event: response.output_text.delta
data: {"type":"response.output_text.delta","delta":"STREAM_TEST_SECTION_1 ... STREAM_TEST_SECTION_12 ..."}
This is immediately followed by:
event: response.output_text.done
event: response.content_part.done
event: response.output_item.done
event: response.completed
Expected behavior
For a long text response with stream: true, I expected the user-visible final answer to be delivered as multiple response.output_text.delta events over time, so the UI can render text incrementally.
Additional notes
The stream itself is not completely broken: I do receive SSE events and keepalives. The issue is that the final answer text appears to be buffered/aggregated and emitted as one large delta.
Also, the response metadata appears to show reasoning settings different from the request in some runs, e.g. reasoning.effort appearing as xhigh and summary as detailed, which may indicate the Codex backend is rewriting or overriding request parameters.
What steps can reproduce the bug?
curl -N https://chatgpt.com/backend-api/codex/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-5.5",
"store": false,
"stream": true,
"max_output_tokens": 6000,
"text": {
"format": { "type": "text" },
"verbosity": "high"
},
"reasoning": {
"effort": "minimal"
},
"tool_choice": "none",
"input": [
{
"role": "user",
"content": [
{
"type": "input_text",
"text": "You are testing streaming behavior. Write a long, detailed report of at least 3500 words. Begin immediately. Use exactly 12 sections. Each section must start with STREAM_TEST_SECTION_N."
}
]
}
]
}'
What is the expected behavior?
As mentioned as above
Additional information
_No response_