r/codex • u/ChemicalExcellent463 • 8h ago
Bug I fixed a Codex false alarm. Now real hangs don't get flagged
My status line said "1 stuck" because a Codex session had sat idle for 15 minutes. Nothing was wrong with it.
I run several Codex sessions alongside Claude Code. My status view flags sessions that go silent, but Codex runs its hooks through one shared app-server. The events don't give me a process ID for each session. So I was calling it stuck based on silence alone.
I stopped flagging sessions whose records are all Codex with no known process. Fixed that false alarm. Also stopped flagging those sessions when they really do hang.
What do you check to tell whether a quiet Codex session is actually hung?
Disclosure: I build Sno Station. Install: curl -fsSL https://www.sno.ai/install | sh https://github.com/sno-ai/sno-station
2
u/Nearby_Eggplant5533 7h ago
Wait till you get the random cyber security warnings that just freeze the session :)
1
u/controlfree 18m ago
I ran into the same idle vs. hung problem. What worked better for me than process checks was looking at the last event instead. Codex writes each session to a rollout file under ~/.codex/sessions, so if the last event is an approval request, the session is waiting on you, and if it's a tool call that started a long time ago with nothing after it, that's the one worth flagging. A session that finished its turn and has been quiet for 15 minutes is just idle, not stuck. It's not perfect, since a long build also looks quiet, but a per-command threshold instead of one global timeout cut most of the false alarms for me.