Bug: Undefined 'summaryParts' error when using GPT-5.4 model
Bug Report
Description
When using GPT-5.4 as the model in Codex CLI, the agent crashes with an undefined 'summaryParts' error during response processing. This does not occur with GPT-5.3-codex.
Steps to Reproduce
- Configure Codex CLI to use
gpt-5.4as the model - Run a prompt that triggers a multi-step response (e.g.,
codex "refactor this function to use async/await") - Observe the error during response summary generation
Expected Behavior
The agent should process the GPT-5.4 response and display the summary without errors.
Actual Behavior
The CLI crashes with an error similar to:
TypeError: Cannot read properties of undefined (reading 'summaryParts')
This appears to happen when the response handler tries to access summaryParts on the response object, which is structured differently in GPT-5.4 compared to GPT-5.3-codex.
Environment
- Codex CLI version: latest (installed via npm)
- Model: gpt-5.4
- OS: macOS (Darwin 25.2.0)
- Node.js: v22.x
Additional Context
GPT-5.4 appears to return a different response structure than what the summary generation code expects. The summaryParts field may have been renamed or restructured in the GPT-5.4 API response format. This is likely a compatibility issue where the Codex CLI response parser needs to handle the updated response schema from newer models.
Related issues with GPT-5.4 compatibility: #13773, #13864
2 Comments
Detailed Reproduction Steps & Error Analysis
Full Reproduction Steps
Step 1: Install/update Codex CLI
Step 2: Configure the model to GPT-5.4
Step 3: Run a multi-step prompt
Step 4: Observe the crash
The agent begins executing, processes the initial response, but crashes during the summary/output phase.
Full Error Output
Debugging Observations
formatResponseSummary()which expectsresponse.outputitems to have asummaryPartsproperty. GPT-5.4 appears to structure this differently.{ type: "message", summaryParts: [...] }{ type: "message", content: [...], summary: { parts: [...] } }The
summaryPartsfield was flattened in 5.3-codex but is now nested undersummary.partsin GPT-5.4.gpt-5.3-codexresolves the issue:``
bash
``codex --model gpt-5.3-codex "refactor the main function to use async/await"
# Works correctly, no crash
codex --model gpt-5.4 "explain this code"trigger the same error when the response includes structured output.Suggested Fix
The response parser in the Codex CLI needs to handle both response structures:
Environment Details
| Component | Version |
|-----------|---------|
| Codex CLI | 0.1.2025061300 |
| Node.js | v22.14.0 |
| npm | 10.9.2 |
| OS | macOS 15.4 (Darwin 25.2.0) |
| Arch | arm64 (Apple Silicon) |
| Model (broken) | gpt-5.4 |
| Model (working) | gpt-5.3-codex |
It looks like you're installing a really old version of the CLI. Please use
npm install -g @openai/codexwithout the@latestextension.