Codex observability Stop hook can exhaust memory on very large rollouts
The Codex observability Stop hook loads the full JSONL rollout into memory before parsing turns. Long sessions can exhaust Node's heap and abort the hook without an exit status. A 37 MB rollout reproduced that failure locally.
langfuse/codex-observability-plugin#107 bounds repeated generation input and makes that rollout complete. It leaves the whole-file load in place, so larger rollouts can still exhaust memory.
The follow-up should parse and export turns with bounded memory. Please preserve rollout-order turn numbers for deterministic trace IDs and only mark a turn uploaded after its export is confirmed, so a failed or interrupted upload can retry it. An oversized single JSONL record also needs an explicit limit or a recoverable error.
Expected: the Stop hook completes or reports a controlled error on very large rollouts, without silently dropping turns or marking failed exports as uploaded.
Source: langfuse/langfuse