Skip to content

feat(codex): document native image generation in /codex skill#1986

Open
seungwonme wants to merge 1 commit into
garrytan:mainfrom
seungwonme:codex-image-gen
Open

feat(codex): document native image generation in /codex skill#1986
seungwonme wants to merge 1 commit into
garrytan:mainfrom
seungwonme:codex-image-gen

Conversation

@seungwonme

Copy link
Copy Markdown

TL;DR

Codex CLI ships a native image-generation tool (image_gen.imagegen), but the /codex skill's hard "read-only, never modify files" rule makes image-generation consults silently fail — the tool call succeeds, the generated PNG just can't be saved. This documents the capability and the one sanctioned exception.

What changed

  • New ## Image Generation section in codex/SKILL.md.tmpl (after Model & Reasoning):
    • swap -s read-only-s workspace-write when the consult asks Codex to MAKE an image (not analyze one)
    • scope writes to a scratch dir under $TMP_ROOT via -C + --skip-git-repo-check, so nothing lands in the user's repo
    • read + open the result for the user, report the file path
  • Important Rules first bullet now names this as the sole exception to "Never modify files"
  • codex/SKILL.md regenerated via bun run gen:skill-docs

Verified

Asked Codex to enumerate its callable tools and generate an image with code-drawing fallbacks (SVG/matplotlib) explicitly forbidden: it listed image_gen.imagegen and produced a real 1254×1254 PNG. Saving worked under workspace-write; the skill's default read-only sandbox blocks it.

Codex CLI ships a native image_gen.imagegen tool, but the skill's
read-only sandbox rule makes image-generation consults silently fail:
the tool call succeeds, the PNG can't be saved.

- Add Image Generation section: swap to -s workspace-write for
  image-making consults, scope writes to a scratch dir under TMP_ROOT
  (-C + --skip-git-repo-check), show the result to the user
- Name this as the sole exception in Important Rules
- Regenerate codex/SKILL.md via bun run gen:skill-docs

Verified by having Codex enumerate its callable tools and generate a
1254x1254 PNG with code-drawing fallbacks (SVG/matplotlib) forbidden.
@trunk-io

trunk-io Bot commented Jun 12, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant