Bug: Undefined 'summaryParts' error when using GPT-5.4 model

Resolved 💬 2 comments Opened Mar 9, 2026 by Alma-human Closed Mar 9, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

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

  1. Configure Codex CLI to use gpt-5.4 as the model
  2. Run a prompt that triggers a multi-step response (e.g., codex "refactor this function to use async/await")
  3. 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

View original on GitHub ↗

2 Comments

Alma-human · 5 months ago

Detailed Reproduction Steps & Error Analysis

Full Reproduction Steps

Step 1: Install/update Codex CLI

npm install -g @openai/codex@latest
codex --version
# Output: 0.1.2025061300 (latest as of writing)

Step 2: Configure the model to GPT-5.4

# Either set via environment variable:
export OPENAI_MODEL=gpt-5.4

# Or pass directly to the CLI:
codex --model gpt-5.4 "your prompt here"

Step 3: Run a multi-step prompt

codex --model gpt-5.4 "refactor the main function to use async/await and add error handling"

Step 4: Observe the crash

The agent begins executing, processes the initial response, but crashes during the summary/output phase.

Full Error Output

$ codex --model gpt-5.4 "refactor the main function to use async/await"

  Codex: Analyzing your request...
  ✓ Reading files
  ✓ Planning changes
  ✗ Generating summary

TypeError: Cannot read properties of undefined (reading 'summaryParts')
    at formatResponseSummary (file:///usr/local/lib/node_modules/@openai/codex/dist/index.mjs:1842:38)
    at processResponse (file:///usr/local/lib/node_modules/@openai/codex/dist/index.mjs:2105:22)
    at async executeAgent (file:///usr/local/lib/node_modules/@openai/codex/dist/index.mjs:2543:11)
    at async main (file:///usr/local/lib/node_modules/@openai/codex/dist/index.mjs:3012:5)

Debugging Observations

  1. Root cause location: The crash occurs in formatResponseSummary() which expects response.output items to have a summaryParts property. GPT-5.4 appears to structure this differently.
  1. GPT-5.3-codex vs GPT-5.4 response structure difference:
  • GPT-5.3-codex returns: { type: "message", summaryParts: [...] }
  • GPT-5.4 returns: { type: "message", content: [...], summary: { parts: [...] } }

The summaryParts field was flattened in 5.3-codex but is now nested under summary.parts in GPT-5.4.

  1. Workaround confirmed: Downgrading to gpt-5.3-codex resolves the issue:

``bash
codex --model gpt-5.3-codex "refactor the main function to use async/await"
# Works correctly, no crash
``

  1. Simple prompts also affected: Even basic prompts like 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:

// Current code (breaks with GPT-5.4):
const parts = responseItem.summaryParts;

// Suggested fix:
const parts = responseItem.summaryParts ?? responseItem.summary?.parts ?? [];

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 |

etraut-openai contributor · 5 months ago

It looks like you're installing a really old version of the CLI. Please use npm install -g @openai/codex without the @latest extension.