codex - 💡(How to fix) Fix hatch-pet skill is not working, seeing a bunch of "Stream disconnected..." errors [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#20947Fetched 2026-05-05 05:55:47
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
1
Timeline (top)
labeled ×5commented ×1

The hatch-pet skill is not working in Codex App. The visible symptom is that the app gets stuck and shows a bunch of "Stream disconnected..." errors.

After debugging, the most likely root cause appears to be image generation skill discovery / materialization: hatch-pet expects a system $imagegen skill at:

${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md

but that file/directory is not present locally.

This may be related to:

Exact visible error, with request ID masked:

stream disconnected before completion: An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID <masked-request-id> in your message.

Error Message

ModuleNotFoundError: No module named 'PIL'

Root Cause

After debugging, the most likely root cause appears to be image generation skill discovery / materialization: hatch-pet expects a system $imagegen skill at:

Code Example

${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md

---

stream disconnected before completion: An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID <masked-request-id> in your message.

---

/Users/<user>/.codex/skills/hatch-pet/SKILL.md

---

/Users/<user>/.codex/skills/.system/imagegen/SKILL.md

---

/Users/<user>/.codex/skills/.system

---

/Users/<user>/.codex/skills
/Users/<user>/.agents/skills
/Users/<user>/.codex/plugins/cache

---

ModuleNotFoundError: No module named 'PIL'

---

/Users/<user>/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3
Pillow 12.2.0

---

/Users/<user>/.codex/skills/hatch-pet/scripts/generate_pet_images.py
RAW_BUFFERClick to expand / collapse

Summary

The hatch-pet skill is not working in Codex App. The visible symptom is that the app gets stuck and shows a bunch of "Stream disconnected..." errors.

After debugging, the most likely root cause appears to be image generation skill discovery / materialization: hatch-pet expects a system $imagegen skill at:

${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md

but that file/directory is not present locally.

This may be related to:

Exact visible error, with request ID masked:

stream disconnected before completion: An error occurred while processing your request. You can retry your request, or contact us through our help center at help.openai.com if the error persists. Please include the request ID <masked-request-id> in your message.

Environment / observed state

hatch-pet is installed at:

/Users/<user>/.codex/skills/hatch-pet/SKILL.md

The skill explicitly delegates normal visual generation to $imagegen and says to load:

/Users/<user>/.codex/skills/.system/imagegen/SKILL.md

But locally:

/Users/<user>/.codex/skills/.system

does not exist.

Search did not find an alternative installed imagegen skill under:

/Users/<user>/.codex/skills
/Users/<user>/.agents/skills
/Users/<user>/.codex/plugins/cache

Reproduction / debugging findings

The hatch pipeline can prepare a run only when using the bundled Codex Python runtime, because the system Python does not have Pillow installed.

System Python failure:

ModuleNotFoundError: No module named 'PIL'

Bundled Codex Python works:

/Users/<user>/.cache/codex-runtimes/codex-primary-runtime/dependencies/python/bin/python3
Pillow 12.2.0

Using the bundled runtime, prepare_pet_run.py succeeds and creates an imagegen-jobs.json manifest. At that point:

  • base is ready
  • all row jobs are blocked
  • no decoded/base.png exists
  • no references/canonical-base.png exists

So the deterministic prep step works, but visual generation never records the first base image.

Why this looks like imagegen discovery rather than only transport

Codex logs do show real stream disconnect / reconnect errors, including websocket and API transport failures. But the hatch artifacts show the pet run stops before any generated image is recorded.

That suggests "Stream disconnected..." is the visible app-level symptom, while the actionable local blocker is that $imagegen is not discoverable/materialized where hatch-pet expects it.

Expected behavior

When a skill depends on $imagegen, Codex App should either:

  1. materialize/discover the system image generation skill at the documented path, or
  2. expose the image generation capability to the skill through the active skill/plugin system, or
  3. fail clearly with an actionable missing-dependency message instead of letting the thread appear stuck with stream disconnect errors.

Actual behavior

The hatch-pet skill expects $imagegen, but the expected system skill path is missing. The app-visible result is a stuck/failed run with "Stream disconnected..." errors.

Additional note

hatch-pet does include a documented secondary fallback script:

/Users/<user>/.codex/skills/hatch-pet/scripts/generate_pet_images.py

It uses OPENAI_API_KEY and OpenAI Images API endpoints. However, the normal path is explicitly supposed to delegate to $imagegen, so this fallback does not address the underlying skill discovery/materialization problem.

extent analysis

TL;DR

The most likely fix is to ensure the $imagegen skill is properly installed and discoverable at the expected path, ${CODEX_HOME:-$HOME/.codex}/skills/.system/imagegen/SKILL.md.

Guidance

  • Verify that the $imagegen skill is installed and configured correctly by checking the existence of the SKILL.md file at the expected path.
  • If the skill is not installed, attempt to install it or create a symbolic link to the correct location.
  • Check the Codex App documentation for any specific instructions on installing and configuring the $imagegen skill.
  • Consider using the fallback script generate_pet_images.py as a temporary workaround, but note that this does not address the underlying skill discovery issue.

Example

No code snippet is provided as the issue is related to skill discovery and configuration rather than code implementation.

Notes

The issue may be related to a known problem in Codex App, as referenced in https://github.com/openai/codex/issues/20946. Ensuring the correct installation and configuration of the $imagegen skill should resolve the issue, but further troubleshooting may be necessary if problems persist.

Recommendation

Apply workaround: Use the fallback script generate_pet_images.py as a temporary solution while investigating the underlying skill discovery issue, as the normal path of delegating to $imagegen is not functioning correctly.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

When a skill depends on $imagegen, Codex App should either:

  1. materialize/discover the system image generation skill at the documented path, or
  2. expose the image generation capability to the skill through the active skill/plugin system, or
  3. fail clearly with an actionable missing-dependency message instead of letting the thread appear stuck with stream disconnect errors.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING