Skip to content

Conversation

oyiakoumis
Copy link
Contributor

@oyiakoumis oyiakoumis commented Aug 28, 2025

What?

Fixes bug where codex exec --image hangs for 10+ minutes, and resolves inconsistent image handling between TUI and exec.

Why?

Bug 1: codex exec --image ./photo.jpg "describe this" causes indefinite hanging due to race condition in event loop
Bug 2: codex exec "what do you see in ./photo.jpg?" treats image paths as text (shows metadata) while TUI correctly displays images

How?

  • Fix race condition: Eliminated competing event consumers that caused --image hanging
  • Unify behavior: Added automatic image path detection to exec (matching TUI behavior)
  • Refactor: Created shared utilities in codex-common/path_utils to prevent future inconsistencies

Result: Both explicit (--image) and implicit (./image.jpg in text) image references now work consistently across TUI and exec.

Testing

  • codex exec --image ./test.jpg "what do you see?" - no longer hangs
  • codex exec "describe ./test.jpg" - now shows actual image instead of metadata
  • ✅ Existing TUI functionality unchanged

Closes #2795

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.

When using --image with exec codex hangs
1 participant