Codex runtime: session stops dispatching after stream compact disconnect
Summary
After a Codex runtime stream disconnect during compact (chatgpt.com), the affected session stops dispatching new messages entirely — inbox accumulates pending items but no new Codex process is spawned.
Environment
- duoduo version: 0.5.4-pre.1
- channel: feishu (channel-feishu 0.5.2-pre.6)
- runtime: codex
Reproduction
- A Codex job or session is running and hits a network disconnect during compact:
````
Error running remote compact task: stream disconnected before completion:
error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)
- After disconnect, the session state shows
last_event_atupdated on new ingress events, but no newstreaming-card startedlog appears. - Session inbox accumulates
.pendingfiles indefinitely. - Subsequent messages from the user get no response.
Observed behavior
From feishu channel logs:
[INFO] [bot] ingress {"msgId":"om_x100b6e44275d2ca8c21994025c002d5", "sessionKey":"lark:oc_473ab07146f5702cfcefea0d63f1a9cd:...", "textLen":6}
— no streaming-card started follows. Three consecutive messages (file attachment, @mention, text) all ingressed but none dispatched.
Session inbox:
2026-05-27T14-57-09-050Z_i6wnj7yu6aj.pending
2026-05-27T14-58-31-457Z_dw84zcdc25c.pending
Root cause (observed)
The stale codex app-server processes (spawned by duoduo at 4:20PM, 5:30PM, 5:52PM) appear to hold dead connections. Killing all three duoduo-managed codex app-server PIDs (22579/22580, 30557/30558, 37887/37888) clears the block. However, duoduo does not auto-restart these processes after kill — next dispatch requires a new message trigger.
Also affected
Same root cause caused daily-tod-noon-scan-1230 job failure:
last_error: "Error running remote compact task: stream disconnected before completion:
error sending request for url (https://chatgpt.com/backend-api/codex/responses/compact)"
Expected behavior
- After a compact stream disconnect, the session should retry or spawn a fresh Codex process for pending inbox items.
- Alternatively, the dispatcher should detect stale Codex app-server processes and restart them automatically.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗