hatch-pet skill is not working, seeing a bunch of "Stream disconnected..." errors

Open 💬 2 comments Opened May 4, 2026 by neilsanghrajka

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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗