Repository navigation
Description
Version: 2026.6.10 (aa69b12), macOS 26.5.1, imessage channel, dmScope per-channel-peer.
Summary: When message B arrives while a long turn for message A is still running in the same DM session, B's turn can compile its context BEFORE A's completed turn is committed to the session transcript. The agent then replies to B with no knowledge of A's turn — in our case flatly contradicting the reply it delivered 5 seconds earlier.
Timeline (from the session's trajectory.jsonl; relative times):
- t+0.0s — turn A starts (
session.started→context.compiled→prompt.submitted). Long agentic turn (~3.2 min, large context ~96k tokens, multiple tool calls). - t+105s — message B arrives mid-turn; queued.
- t+193.9s — turn A:
model.completed(t+193.92session.ended). Its reply is delivered: "[work] done, file sent." - t+194.35s — turn B:
session.started;context.compiledat t+194.36 — 425 ms after turn A ended — and turn B's compiled context is missing turn A's entire exchange (its reply says the message that started turn A "never came through" and cites state from hours earlier). - t+198.5s — turn B's contradictory reply is delivered to the same human, 5s after turn A's.
Supporting signals: turn B's compiled input was far smaller than the live session (~<50k vs ~96k); no compaction events occurred in this window (all compactions that day were hours earlier), so this looks like queue-release racing the transcript write-back rather than compaction.
Expected: a queued message's turn must never compile against session state older than the last delivered assistant message — i.e., release the queue on transcript-commit, not on model-completion (or have context.compiled block on the pending append).
Impact: user-facing self-contradiction — worst-case trust damage for assistant products. Happy to provide sanitized trajectory excerpts.
Reported from a production fleet running OpenClaw on Mac minis; happy to test a patch.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 10, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 10, 2026, 5:50 AM ET / 09:50 UTC.
Summary
Keep open. The report gives a precise production ordering failure on v2026.6.10, while current main has no focused regression or fix provenance proving that the prior assistant transcript is visible before the next queued turn compiles context; the supplied related issues have distinct stall, restart, or admission failure modes.
Reproducibility: no. not yet on current main. The production timeline is strong and identifies a narrow concurrency window, but no current-main test or live run has reproduced the missing prior-turn transcript after queued admission.
Ways to help us reproduce this
Next step
The report is concrete and the shared-core boundary is bounded enough for one focused repair attempt, beginning with a deterministic regression.
Review details
Best possible solution:
Make existing reply-operation completion await all canonical session-event and transcript writes required by the next turn, then add a regression that delays turn A's final append while turn B is queued.
Do we have a high-confidence way to reproduce the issue?
No, not yet on current main. The production timeline is strong and identifies a narrow concurrency window, but no current-main test or live run has reproduced the missing prior-turn transcript after queued admission.
Is this the best way to solve the issue?
No, not exactly as phrased: releasing from a separate transcript-commit signal could create competing completion sources. The narrowest maintainable fix is to make the existing reply-operation/session-owner completion boundary include the required transcript finalization.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against 7fe004d85251.
Label changes
Label changes:
P1: The production race caused the assistant to contradict a reply delivered five seconds earlier in the same direct-message session.impact:session-state: The queued turn compiled against session state that omitted the immediately preceding completed exchange.issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.clawsweeper:needs-info: Current issue advisory state selects this label.Label justifications:
P1: The production race caused the assistant to contradict a reply delivered five seconds earlier in the same direct-message session.impact:session-state: The queued turn compiled against session state that omitted the immediately preceding completed exchange.Evidence reviewed
Acceptance criteria:
What I checked:
src/auto-reply/reply/agent-runner.ts:148, 7fe004d85251)src/auto-reply/reply/agent-runner.ts:138, aa69b12d0086)src/auto-reply/reply/agent-runner.ts:2804, 7fe004d85251)src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts:2288, 7ac8b48a08bf)Likely related people:
src/auto-reply/reply/agent-runner.ts,src/auto-reply/reply/reply-run-registry.ts)src/auto-reply/reply/agent-runner.ts,src/auto-reply/reply/queue/drain.ts)src/auto-reply/reply/queue/drain.ts,src/agents/embedded-agent-runner/run/attempt.ts)src/agents/embedded-agent-runner/run/attempt.ts,src/agents/embedded-agent-runner/run/attempt.spawn-workspace.context-engine.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.openclaw-barnacle commentedon Jul 25, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
steipete commentedon Jul 27, 2026
Thanks for the detailed production timeline; the queue-release/old-context race reported against 2026.6.10 is addressed on current main (e57549c).
Current production behavior:
src/auto-reply/reply/dispatch-from-config.lifecycle.tswaits for tracked turn-lifecycle work and final reply delivery, then releases the reply operation withcompleteWithAfterClearBarrier; queued follow-ups cannot overtake the preceding turn.src/auto-reply/reply/reply-turn-admission.tswaits for that per-session follow-up admission barrier and rechecks the authoritative session identity.src/auto-reply/reply/followup-runner.tsreloads the persisted session after admission instead of compiling from the stale enqueue-time snapshot.The exact ordering is protected by
src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts(clears the reply lane but defers follow-up admission until final delivery settles) andsrc/auto-reply/reply/reply-turn-admission.test.ts(keeps an already-waiting follow-up behind the delivery barrier). The steering sibling is covered bysrc/auto-reply/reply/agent-runner.runreplyagent.e2e.test.ts(waits for transcript commit and keeps a rejected adoption finalizer irrevocably adopted).Landed dispatch-lifecycle implementation: 668e5e8096ad
Landed queue/session-state reload: 2c31af136429
Landed final-delivery ordering regression: c67dc59b02b0
Landed transcript-commit regression: f79e8859855b
Closing as completed based on the current canonical source and focused checked-in regression evidence for the reported stale queued-turn ordering.