openclaw - 💡(How to fix) Fix Codex runtime sessions should recover when persisted app-server thread id is missing

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

If a persisted Codex app-server thread id is missing during preflight compaction, OpenClaw should retire or refresh the app-server sidecar and continue with a new thread while preserving the OpenClaw transcript. A stale sidecar should not leave channel dispatch permanently broken behind a generic user-facing error.

Fix Action

Fix / Workaround

  • OpenClaw 2026.5.22 (a374c3a)
  • Main agent using openai-codex / Codex runtime
  • Trigger path: Telegram direct-message dispatch

A direct-message session became permanently pinned to a missing Codex app-server thread id. Incoming messages reached OpenClaw, but dispatch failed before normal agent execution and users only saw the generic failure response:

  • Inbound Telegram DM was received and routed to a session key shaped like agent:main:telegram:direct:<redacted-chat-id>.
  • Dispatch failed before normal agent execution:

Code Example

Something went wrong while processing your request. Please try again.

---

Preflight compaction required but failed: thread not found: <redacted-app-server-thread-id>
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw 2026.5.22 (a374c3a)
  • Main agent using openai-codex / Codex runtime
  • Trigger path: Telegram direct-message dispatch

Impact

A direct-message session became permanently pinned to a missing Codex app-server thread id. Incoming messages reached OpenClaw, but dispatch failed before normal agent execution and users only saw the generic failure response:

Something went wrong while processing your request. Please try again.

Outbound Telegram transport was otherwise healthy.

Evidence

  • Inbound Telegram DM was received and routed to a session key shaped like agent:main:telegram:direct:<redacted-chat-id>.
  • Dispatch failed before normal agent execution:
Preflight compaction required but failed: thread not found: <redacted-app-server-thread-id>
  • The OpenClaw session store row still existed and the transcript file still existed at agents/main/sessions/<redacted-session-id>.jsonl.
  • The Codex app-server sidecar still existed at agents/main/sessions/<redacted-session-id>.jsonl.codex-app-server.json and still pointed at the missing app-server thread id.
  • Moving only that stale sidecar aside caused OpenClaw to create a fresh app-server thread id, after which the same session key succeeded again with openclaw agent --session-key agent:main:telegram:direct:<redacted-chat-id> ....

Expected behavior

If a persisted Codex app-server thread id is missing during preflight compaction, OpenClaw should retire or refresh the app-server sidecar and continue with a new thread while preserving the OpenClaw transcript. A stale sidecar should not leave channel dispatch permanently broken behind a generic user-facing error.

Suggested fix

  • Detect thread not found during preflight compaction.
  • Mark the sidecar stale and create a replacement Codex app-server thread for the same OpenClaw session.
  • Preserve the transcript and record the recovery in logs.
  • Consider extending openclaw sessions cleanup to detect stale Codex app-server sidecars, not just missing transcript files.

Local recovery used

Backed up the stale sidecar under agents/main/sessions/stale-thread-backups/ and let the next run create a new sidecar. That restored dispatch for the existing direct-message session key without deleting the transcript.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

If a persisted Codex app-server thread id is missing during preflight compaction, OpenClaw should retire or refresh the app-server sidecar and continue with a new thread while preserving the OpenClaw transcript. A stale sidecar should not leave channel dispatch permanently broken behind a generic user-facing error.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING