Skip to content

[codex] Fix Windows image_gen fallback for sprites#5

Draft
luyh7 wants to merge 1 commit into
0x0funky:mainfrom
luyh7:codex/fix-windows-imagegen-fallback
Draft

[codex] Fix Windows image_gen fallback for sprites#5
luyh7 wants to merge 1 commit into
0x0funky:mainfrom
luyh7:codex/fix-windows-imagegen-fallback

Conversation

@luyh7

@luyh7 luyh7 commented Jun 21, 2026

Copy link
Copy Markdown

Summary

  • Adds a save_imagegen_result.py helper that can persist Codex image_generation_call.result base64 output as a local image file.
  • Updates the $generate2dsprite raw-image handoff contract to avoid stale generated_images files and guessed /mnt/data/... paths.
  • Documents that this fallback is for the Windows/Codex Desktop-only failure mode where image_gen renders in chat but does not write a current PNG under the expected generated-images directory.

Root Cause

This fixes #4. The bug only shows up on Windows/Codex Desktop sessions: the generated image is visible in the conversation, but no matching current file appears under $CODEX_HOME/generated_images or ~/.codex/generated_images. The sprite processor then receives no valid --input PNG and stops before producing sheet-transparent.png, frame PNGs, or GIF output.

The new contract falls back to the current Codex session JSONL / image_generation_call.result base64 payload, decodes it into the run-local generated_images/ folder, and then feeds that stable path into the existing processor.

Validation

  • python3 -m py_compile skills/generate2dsprite/scripts/save_imagegen_result.py
  • Fixture session JSONL containing an unrelated data:image/... tool output plus an image_generation_call.result; helper decoded the latest image call into a PNG.
  • python3 skills/generate2dsprite/scripts/generate2dsprite.py process --input <decoded_png> --target creature --mode idle ... produced sheet-transparent.png, four frame PNGs, animation.gif, and pipeline-meta.json.

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.

generate2dsprite 生成图片时 Codex 的 image_gen 工具没有把生成图落到可读的本地 PNG 路径

1 participant