fix(sessions): compare reply init revisions using persisted shape#96936
fix(sessions): compare reply init revisions using persisted shape#96936moeedahmed wants to merge 1 commit into
Conversation
|
Thanks for the context here. I did a careful shell check against current Current main already contains the central persisted-shape reply-session revision fix from merged #97657, with matching source, regression coverage, and live before/after proof; this PR now has no meaningful unique user-facing fix left to merge. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the merged main implementation from #97657 and close this redundant branch rather than merging the remaining comment/export churn. Do we have a high-confidence way to reproduce the issue? Yes for the original bug: the merged sibling PR documents a live Discord repro with the fix hunk reverted, and current main has a focused regression test for the persisted-versus-runtime skills snapshot mismatch. I did not rerun the live transport flow during this read-only cleanup review. Is this the best way to solve the issue? Yes, the solution now on main is the best layer: it normalizes only the shared session-accessor revision comparison instead of adding channel-specific handling. This PR's remaining diff is no longer the best way to solve the issue because the implementation already landed elsewhere. Security review: Security review cleared: No concrete security or supply-chain concern was found; the remaining diff only touches session-store comments/tests and an internal export, with no dependencies, workflows, secrets, permissions, or external code execution. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against ff1e7e1305cc; fix evidence: commit 75db48a17522, main fix timestamp 2026-06-29T04:45:50Z. |
|
Updated the PR description to OpenClaw contributor format with What Problem This Solves, Why This Change Was Made, User Impact, and Evidence sections, including local validation and runtime proof. |
526fedb to
f511843
Compare
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
Telegram forum-topic
/newand/resetcan be accepted by the bot but fail to rotate the topic session. In the affected runtime path, OpenClaw logs repeatedreply session initialization conflictederrors and keeps retrying the Telegram update from the ingress spool even though no real concurrent session edit occurred.Why This Change Was Made
Reply-session initialization uses a guarded revision check. The snapshot side reads the persisted session entry shape from disk, while the commit side may read the live writer cache. Those two representations can be semantically equivalent but structurally different:
skillsSnapshot.resolvedSkillspromptRefThe old revision check used raw
JSON.stringify(entry), so equivalent persisted/runtime shapes compared as different and produced a falsestale-snapshotconflict. This PR compares the canonical persisted shape instead.User Impact
/newand/resetare less likely to get stuck in Telegram topics after skills prompt hydration or runtime skill-cache activity.Evidence
AI-assisted: yes. Hermes investigated the production symptom, implemented the minimal source fix, and verified it locally before opening this PR.
Local validation on this PR branch:
node scripts/run-vitest.mjs src/config/sessions/session-accessor.test.ts -t "runtime-only resolvedSkills"— passed, 1 regression test selectednode scripts/run-vitest.mjs src/config/sessions/session-accessor.test.ts src/config/sessions/store.skills-stripping.test.ts src/auto-reply/reply/session.test.ts src/config/sessions/store-writer.test.ts— passed, 199 related testsnode_modules/.bin/oxfmt --check --threads=1 src/config/sessions/session-accessor.ts src/config/sessions/session-accessor.test.ts src/config/sessions/store-load.ts src/config/sessions/store.ts— passedpnpm tsgo:core— passedpnpm tsgo:core:test— passedRuntime evidence from the local OpenClaw deployment after applying the same fix and restarting the gateway:
{"ok":true,"status":"live"}ok000reply session initialization conflictedentries and0failed spooled updatesNotes for Reviewers
The regression test creates a persisted skills snapshot, takes the reply-session initialization snapshot, mutates the live cached entry with runtime-only
resolvedSkills, then verifiescommitReplySessionInitializationstill commits. The implementation projects both sides to the canonical persisted entry shape before revision comparison, including prompt-ref projection for hydrated prompts.