Codex calls prompt-only image generation despite hard gates requiring actual image references
Summary
Codex Desktop repeatedly proceeded toward prohibited image-generation routes even though global AGENTS.md, project AGENTS.md, user instructions, and a task-specific skill all required actual image-reference inputs and explicitly banned prompt-only generation, Photoshop, ComfyUI, alternate tool exploration, and mask/edit/inpaint workarounds.
This looks like an instruction-following and tool-selection bug, not merely an ambiguous user prompt. The agent recognized that actual template/reference images were required, but still attempted routes where those images could not be attached as actual inputs.
Environment
- Product: Codex Desktop app
- Runtime from
codex doctor:0.142.0-alpha.6 - App install path from doctor:
/Applications/Codex.app/Contents/Resources/codex - Model from doctor:
gpt-5.5 - OS from doctor: macOS 26.5.1
- Auth mode from doctor: ChatGPT tokens
- Doctor-reported approval policy:
OnRequest - Thread/developer context reported approval policy:
never - Filesystem sandbox: unrestricted
- Network sandbox: enabled
Expected behavior
When a task requires actual image references:
- Do not call a generation tool whose exposed schema only accepts a text prompt.
- Do not treat local file paths written in a prompt as equivalent to attached image references.
- Do not switch to Photoshop, ComfyUI, browser workarounds, local generation servers, external providers, edit/inpaint, or mask-edit routes when those are explicitly banned.
- If the tool cannot receive the required images, stop before the tool call and report the missing gate.
- Respect AGENTS.md, project AGENTS.md, task skill, and repeated user instructions as hard gates.
Actual behavior
The agent repeatedly did the opposite:
- Called or attempted prompt-only image generation while claiming to use required template/reference images.
- Wrote local paths into prompts as if that counted as image-reference attachment.
- Moved toward prohibited tools/routes, including Photoshop and ComfyUI, after those routes had been banned.
- Added a hard gate after failures, then still failed to stop before an invalid tool route.
- Treated STOP states as a kind of progress or got stuck without returning to the approved route.
Why this appears to be a product bug
The image-generation skill text describes reference-image workflows, but the exposed image_gen tool schema in this session accepted only:
{ "prompt": "string" }
There was no parameter for local image files or actual image references. In that situation, the correct behavior is to stop, not to pass file paths inside the prompt.
The failure also happened despite explicit local rules:
- Global AGENTS.md required
TEMPLATE_REF,REF_SUPPORTED=yes,ROUTE=画像参照入力ありの新規生成, andCOORDINATE_SOURCE. - Global AGENTS.md explicitly banned
TEMPLATE_REFなし,参照画像非対応,text-only生成, and prompt/profile/bbox substitution. - Project AGENTS.md explicitly said
image_gen 直呼びで画像添付引数がない = no,Photoshop = no,ComfyUI = no,別ツール探索 = no. - The task skill added a C01 hard gate requiring actual image attachment proof for the chart/template/reference images before generation.
Minimal reproduction shape
- Configure a task where AGENTS.md requires actual image-reference inputs before image generation.
- Expose an image-generation tool whose schema only accepts a text prompt.
- Ask Codex to generate an LED chart component from local template/reference image files.
- Codex should stop because the active tool cannot attach those images.
- Instead, Codex attempts prompt-only image generation or alternate prohibited routes.
Impact
This caused repeated invalid outputs and a long failure loop in a production image workflow. The user had explicitly warned that prompt-only and non-template routes would fail, but Codex continued down those routes.
Requested fix
Please make Codex enforce a pre-tool gate when:
- A rule requires actual image-reference inputs.
- The selected tool has no image-reference parameter.
- The user or AGENTS.md explicitly bans prompt-only generation or alternate tools.
In that case, Codex should not call the tool. It should produce a STOP message with the missing capability.
Please also align the image-generation skill description with the actual exposed tool schema, or make the tool schema expose the real image-reference inputs when the skill says references are supported.
Notes
I intentionally did not attach private local files or full conversation logs to this public issue. The key issue is the mismatch between hard-gated instructions and tool capability/selection.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗