fix(sessions): align reply init revision with persisted skillsSnapshot#96699
fix(sessions): align reply init revision with persisted skillsSnapshot#96699wiidz wants to merge 1 commit into
Conversation
Compare reply session initialization revisions using the on-disk skillsSnapshot shape (promptRef) instead of hydrated writer-cache prompt text, which caused false stale-snapshot conflicts on the second inbound turn. Also await inbound meta recording before last-route updates to avoid concurrent session store writes. Fixes openclaw#96698 Co-authored-by: Cursor <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed June 25, 2026, 4:10 AM ET / 08:10 UTC. Summary PR surface: Source +20. Total +20 across 2 files. Reproducibility: yes. at source level: current main compares whole session-entry JSON revisions, and persisted promptRef versus hydrated prompt shapes can differ. I did not run live Discord in this read-only review. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Keep runtime initialization snapshots hydrated, compute only the optimistic-concurrency revision from a persisted/unhydrated representation, then add focused regression coverage and redacted Discord proof before merge. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main compares whole session-entry JSON revisions, and persisted promptRef versus hydrated prompt shapes can differ. I did not run live Discord in this read-only review. Is this the best way to solve the issue? No. Persisted-shape revision comparison is the right direction, but this patch also changes runtime snapshot shape; the safer fix is to normalize only the revision while preserving hydrated currentEntry/readEntry behavior. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 793b604b2377. Label changesLabel justifications:
Evidence reviewedPR surface: Source +20. Total +20 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Thanks @wiidz for both the original issue report and this early fix direction. The root cause identified here was correct: reply-session initialization was comparing equivalent session entries in different The merged version keeps runtime initialization snapshots hydrated and normalizes only the persisted-shape revision comparison, which addresses the review concern on this PR while fixing the Discord second-message failure. It also includes focused regression coverage and live Discord proof showing the failure with the fix reverted and success with the fix applied. Closing this PR as superseded by #97657. |
Summary
skillsSnapshotshape (promptRef) instead of hydrated writer-cacheprompttextupdateLastRouteto avoid concurrent session store writesFixes #96698
Problem
The second inbound Discord message (and likely any channel) fails with:
createReplySessionInitializationRevision()serializes the full session entry, but snapshot load and commit compared differentskillsSnapshotshapes: persisted{ skills, promptRef }vs hydrated{ skills, prompt }. This produced falsestale-snapshotconflicts after the first agent run.Test plan
stale-snapshot/ initialization conflict on second turnMade with Cursor