I’m seeing a recurring reliability issue when using OpenClaw across multiple Discord/channel contexts or when several messages/files are coming in close together.
Today I received this error:
“⚠️ Codex app-server connection closed before this turn finished. OpenClaw retried once when the stdio turn was still replay-safe; please try again if this keeps happening.”
What was happening at the time:
- I was working in Discord through OpenClaw.
- The task involved multiple turns/messages in the same channel.
- I had uploaded PDF attachments and was asking Codex/OpenClaw to review them and generate a PDF output.
- While the agent was working, additional messages/status checks were sent.
- The turn appeared to get interrupted/hung, and the app-server connection closed before completion.
- This seems more likely when multiple channels/messages/tool calls are active or when I interrupt/check status while a longer task is running.
Impact:
- Long-running tasks become unreliable.
- The agent may lose continuity or fail before delivering the output file.
- I have to resend context or ask for status repeatedly.
- It makes document-heavy workflows hard to trust.
What I need help with:
- Confirm what causes “Codex app-server connection closed before this turn finished.”
- Determine whether this is an OpenClaw orchestration issue, Codex stdio/session issue, Discord message handling issue, or a timeout/resource issue.
- Add better recovery behavior so long-running tasks can continue or resume safely after interruptions.
- Prevent multi-message/channel activity from causing the active task to hang or drop.
- Provide recommended workflow/config changes if I should be handling long document-generation tasks differently.
Useful context:
- Surface: Discord channel conversation through OpenClaw
- Task type: PDF review + generated PDF output
- Attachments: multiple PDFs
- Behavior: turn aborted / connection closed / retry only happened once because stdio replay was considered safe
Please let me know what logs, config files, timestamps, or reproduction steps you need. I can provide the exact time, channel, and task details.