openclaw - 💡(How to fix) Fix [Bug]: Codex resumes ignore OpenClaw-visible messages written after native binding [1 pull requests]

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…

After PR #88262, Codex app-server resumes can ignore OpenClaw-visible user/assistant messages that were written after the Codex native thread binding was created.

Before the PR, hasUserVisibleHistoryAfterCodexBinding(...) detected this case and forced projection of the newer visible history into the next Codex start. The PR removed that guard and added a test that asserts the newer visible messages are not injected.

That is unsafe for sessions where OpenClaw-visible transcript state can advance outside the native Codex thread, for example imported messages, transcript repair, non-Codex participants, channel handoff, or any multi-agent/source conversation where the native Codex thread is only one consumer of the OpenClaw transcript.

Error Message

  • or reject/fail with a clear "native thread is stale relative to OpenClaw transcript" error.

Root Cause

After PR #88262, Codex app-server resumes can ignore OpenClaw-visible user/assistant messages that were written after the Codex native thread binding was created.

Before the PR, hasUserVisibleHistoryAfterCodexBinding(...) detected this case and forced projection of the newer visible history into the next Codex start. The PR removed that guard and added a test that asserts the newer visible messages are not injected.

That is unsafe for sessions where OpenClaw-visible transcript state can advance outside the native Codex thread, for example imported messages, transcript repair, non-Codex participants, channel handoff, or any multi-agent/source conversation where the native Codex thread is only one consumer of the OpenClaw transcript.

Fix Action

Fixed

Code Example

sequenceDiagram
    participant OC as OpenClaw session JSONL
    participant Bind as Codex binding
    participant Native as Native Codex thread
    participant Run as Next Codex run

    OC->>Bind: T0 create binding to native thread
    Bind->>Native: Native thread knows history up to T0
    OC->>OC: T1 append user-visible / assistant-visible message
    Note over OC: Message is visible in OpenClaw transcript but not in native Codex thread
    Run->>Bind: Binding still looks resumable
    Run->>Native: thread/resume succeeds
    Run->>Native: turn/start sends only current prompt
    Native-->>Run: Responds without T1 context

---

flowchart TD
    A["Existing Codex binding"] --> B["Check binding timestamp / known transcript watermark"]
    B --> C{"Any user/assistant visible messages after binding?"}
    C -->|No| D["Resume native Codex thread with current prompt only"]
    C -->|Yes| E["Project only newer non-Codex-visible messages as quoted context"]
    E --> F["Resume or rotate with explicit stale-binding recovery"]
RAW_BUFFERClick to expand / collapse

Bug type

Regression / behavior bug in Codex app-server resume continuity.

Summary

After PR #88262, Codex app-server resumes can ignore OpenClaw-visible user/assistant messages that were written after the Codex native thread binding was created.

Before the PR, hasUserVisibleHistoryAfterCodexBinding(...) detected this case and forced projection of the newer visible history into the next Codex start. The PR removed that guard and added a test that asserts the newer visible messages are not injected.

That is unsafe for sessions where OpenClaw-visible transcript state can advance outside the native Codex thread, for example imported messages, transcript repair, non-Codex participants, channel handoff, or any multi-agent/source conversation where the native Codex thread is only one consumer of the OpenClaw transcript.

Why this is high confidence

Diagram

sequenceDiagram
    participant OC as OpenClaw session JSONL
    participant Bind as Codex binding
    participant Native as Native Codex thread
    participant Run as Next Codex run

    OC->>Bind: T0 create binding to native thread
    Bind->>Native: Native thread knows history up to T0
    OC->>OC: T1 append user-visible / assistant-visible message
    Note over OC: Message is visible in OpenClaw transcript but not in native Codex thread
    Run->>Bind: Binding still looks resumable
    Run->>Native: thread/resume succeeds
    Run->>Native: turn/start sends only current prompt
    Native-->>Run: Responds without T1 context

Expected behavior

If OpenClaw-visible messages exist after the Codex binding timestamp, the next Codex run must not assume the native Codex thread already knows them.

It should do one of the following:

  • project the newer visible messages once as quoted context,
  • rotate/start a new Codex thread with bounded continuity context,
  • route through an active context engine that includes those newer messages,
  • or reject/fail with a clear "native thread is stale relative to OpenClaw transcript" error.

Silent resume with only the current prompt is the broken case.

Actual behavior

The merged code resumes the native Codex thread and sends only the current prompt. The newer OpenClaw-visible messages are neither in the native thread nor in the turn input.

The current test named does not inject newer OpenClaw-visible history after Codex binding on resume makes this behavior explicit.

Minimal reproduction shape

  1. Create a session file.
  2. Write a Codex app-server binding at time T0.
  3. Append a user or assistant message at T1 > T0 that is not a Codex mirrored transcript echo.
  4. Run the next Codex app-server attempt with no active context engine.
  5. Make thread/resume succeed.
  6. Inspect the turn/start input.

Expected: the newer visible message is represented in the input or an explicit stale-binding recovery path runs.

Actual: the input is only the current prompt.

Impact

This creates a split-brain transcript:

  • OpenClaw's canonical session has the newer visible message.
  • The native Codex thread does not.
  • The next Codex response is persisted back into OpenClaw as if it answered in the full OpenClaw-visible context.

That can produce wrong answers, skipped instructions, repeated work, or unsafe policy drift in any flow where Codex is not the only writer/reader of the visible conversation.

This matters especially for integrations that treat OpenClaw as the source-of-truth transcript and Codex native threads as an execution backend.

Suggested fix direction

Restore the removed stale-binding guard, but keep it separated from normal native Codex model history:

flowchart TD
    A["Existing Codex binding"] --> B["Check binding timestamp / known transcript watermark"]
    B --> C{"Any user/assistant visible messages after binding?"}
    C -->|No| D["Resume native Codex thread with current prompt only"]
    C -->|Yes| E["Project only newer non-Codex-visible messages as quoted context"]
    E --> F["Resume or rotate with explicit stale-binding recovery"]

Important details from the removed helper should be preserved:

  • exclude Codex app-server mirrored transcript entries, so Codex does not see its own prior output twice,
  • only treat user/assistant visible messages as stale-binding evidence,
  • compare against binding creation/update timestamps or a stronger transcript watermark,
  • add a regression test that distinguishes "Codex mirrored echo after binding" from "real OpenClaw-visible message after binding".

Evidence checked

  • Merged PR: openclaw/openclaw#88262
  • Merge commit: 530351e394a19b1dd2943cb08259657a13f90572
  • Base commit containing removed helper: f52355ce5f8c636fb6e0ef9ef73dfe97a3e82ddb
  • PR head audited locally: 04a4427d0c0b8f2e7bb666bbbcda5c557d033972

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 OpenClaw-visible messages exist after the Codex binding timestamp, the next Codex run must not assume the native Codex thread already knows them.

It should do one of the following:

  • project the newer visible messages once as quoted context,
  • rotate/start a new Codex thread with bounded continuity context,
  • route through an active context engine that includes those newer messages,
  • or reject/fail with a clear "native thread is stale relative to OpenClaw transcript" error.

Silent resume with only the current prompt is the broken case.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Codex resumes ignore OpenClaw-visible messages written after native binding [1 pull requests]