Regression in gpt-5.6 (Luna/Terra): models hallucinate image_gen completion

Resolved 💬 1 comment Opened Jul 10, 2026 by gileneusz Closed Jul 10, 2026

What version of Codex CLI is running?

codex-cli 0.144.0

What subscription do you have?

Pro 20x

Which model were you using?

gpt-5.6-luna and gpt-5.6-terra (affected)

What platform is your computer?

Darwin 25.5.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Non-interactive codex exec from zsh (also reproduced headless); no multiplexer.

Codex doctor report

What issue are you seeing?

In codex exec, gpt-5.6 models (gpt-5.6-luna, gpt-5.6-terra) never invoke the built-in image_gen tool and hallucinate having done so: the model reads the bundled imagegen skill (cat $CODEX_HOME/skills/.system/imagegen/SKILL.md), makes no tool call, replies DONE and exits rc=0 — zero images are produced (nothing new under $CODEX_HOME/generated_images/).

This is a regression vs both gpt-5.5 and gpt-5.4-mini: the exact same minimal prompt on the same account and CLI version produces an image on both older models. Notably gpt-5.5 reads the same SKILL.md and then correctly executes the tool call — 5.6 reads the same instructions, skips execution, and reports success it never achieved. Because rc=0 with a confident completion message, this is a silent failure for any automation built on codex exec.

Possibly relevant: the tool wire name differs between families. Asked to list available tools in the same setup, gpt-5.4-mini reports image_gen.imagegen (dot notation) while gpt-5.6-luna reports image_gen__imagegen (double underscore). So the tool IS wired for 5.6 — the models just never call it, even when prompted with image_gen__imagegen verbatim.

What steps can reproduce the bug?

codex exec --skip-git-repo-check -m gpt-5.6-luna \
  "Use the image_gen tool to create an image: a blue circle on a white background. After the tool returns, reply exactly: DONE"

Actual: rc=0 in ~23 s, model cats the imagegen SKILL.md, no image_gen call, replies DONE, no files created under $CODEX_HOME/generated_images/.

Control runs — identical command, only the model changed:

| Model | Reads imagegen SKILL.md? | Calls the tool? | Image produced |
|---|---|---|---|
| gpt-5.4-mini | no (calls tool directly) | yes | yes (~19 s) |
| gpt-5.5 | yes | yes | yes (~23 s) |
| gpt-5.6-luna / -terra | yes | no | no — replies DONE anyway |

Verify with: find $CODEX_HOME/generated_images -name 'call_*.png' -newermt '<run start time>'

What is the expected behavior?

gpt-5.6 models should invoke the built-in image_gen tool like gpt-5.5 and gpt-5.4-mini do (and as the bundled skill instructs, cf. https://developers.openai.com/learn/imagegen) — or at minimum fail loudly ("tool not available") instead of exiting rc=0 with a hallucinated DONE and no artifact.

Additional information

Not a prompt / reasoning-effort / config issue — 8/8 failures on 5.6:

  • gpt-5.6-luna at effort low (×2), medium and high — all fail identically
  • gpt-5.6-terra at low — fails
  • prompt explicitly forbidding skill reading and demanding an immediate tool call — fails (no SKILL.md read that time, still no tool call, still DONE)
  • prompt addressing the tool by its exact wire name image_gen__imagegen — fails
  • features.image_generation = stable/true (codex features list)

Possibly related (older models/versions, different symptom — explicit "tool not available" rather than silent hallucination): #21640, #19133

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗