Problem
When Codex runs through the conversion route, its JSONL stream includes lifecycle events such as thread.started and turn.started. It can also emit a nonfatal model-catalog refresh diagnostic on stderr and then continue successfully.
The current adapter ignores the lifecycle start events and forwards the full diagnostic response body. The browser also marks a conversion as done whenever the SSE stream ends, even when the agent has a non-zero or missing exit code or produced no HTML. Together, this makes a run look stalled or successful without a reliable terminal state.
Reproduction
- Run
pnpm -F @html-anything/next dev.
- Select Codex and start any conversion.
- Observe a lifecycle diagnostic before the assistant output.
- Observe that completion is not derived from both the process exit code and generated HTML.
Redacted real-session event shape:
thread.started
turn.started
item.completed (diagnostic)
item.completed (agent message)
turn.completed
Expected behavior
- Surface the Codex session and generation start events.
- Treat diagnostic items as warnings rather than generated HTML.
- Preserve useful stderr context while redacting appended response bodies.
- Mark a conversion done only after exit code 0 and non-empty HTML.
- Keep provider and model selection inherited from the existing Codex CLI configuration.
Problem
When Codex runs through the conversion route, its JSONL stream includes lifecycle events such as
thread.startedandturn.started. It can also emit a nonfatal model-catalog refresh diagnostic on stderr and then continue successfully.The current adapter ignores the lifecycle start events and forwards the full diagnostic response body. The browser also marks a conversion as done whenever the SSE stream ends, even when the agent has a non-zero or missing exit code or produced no HTML. Together, this makes a run look stalled or successful without a reliable terminal state.
Reproduction
pnpm -F @html-anything/next dev.Redacted real-session event shape:
Expected behavior