fix: prevent stale skill snapshots blocking Discord replies#97657
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 12:41 AM ET / 04:41 UTC. Summary PR surface: Source +29, Tests +55. Total +84 across 4 files. Reproducibility: yes. at source level: current main JSON-stringifies the whole entry while store loads can represent the same skillsSnapshot as promptRef, hydrated prompt, or resolvedSkills. The PR body also reports a live Discord repro with the fix hunk reverted. Review metrics: none identified. Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land one canonical persisted-shape revision comparison after required checks are green, then close the linked issue and stale duplicate candidate PRs. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main JSON-stringifies the whole entry while store loads can represent the same skillsSnapshot as promptRef, hydrated prompt, or resolvedSkills. The PR body also reports a live Discord repro with the fix hunk reverted. Is this the best way to solve the issue? Yes: the PR uses the existing persistence projection boundary instead of changing runtime snapshot hydration or adding Discord-specific handling. The remaining blocker is merge validation, not a different code shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against bf66b4e1ea7e. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +29, Tests +55. Total +84 across 4 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
|
Bring upstream/main into frond-scribe/20260624/assembly-continuation-followons, including the canonical reply-init fix from upstream openclaw#97657, while preserving continuation assembly behavior and resolving the three drift conflicts. Co-authored-by: Copilot <[email protected]>
…enclaw#97657) (cherry picked from commit 75db48a)
Cherry-picked from 75db48a (openclaw#97657) to prevent cache hydration differences from causing false-positive stale-snapshot conflicts.
Closes #96698
What Problem This Solves
Fixes an issue where users sending a second Discord message in the same session could receive no reply when the first turn persisted a large skills snapshot as a prompt blob.
Why This Change Was Made
The reply-session initialization guard now compares the canonical persisted session-entry shape instead of the live hydrated runtime object. That keeps real stale-session protection intact while ignoring equivalent representation differences such as hydrated
skillsSnapshot.prompttext and runtime-onlyresolvedSkillscache entries.This change stays in the shared session file-backend boundary rather than adding Discord-specific handling, because the false conflict is caused by session snapshot revision comparison.
User Impact
Discord users can continue an existing agent conversation after a skills snapshot is persisted as a prompt blob. Other channel/session users benefit from the same shared guard behavior, and true concurrent durable session changes still reject as stale.
AI-assisted change.
Evidence
.agents/skills/autoreview/scripts/autoreview --mode localcompleted cleanly with no accepted/actionable findings before commit.node scripts/run-vitest.mjs src/config/sessions/session-accessor.test.tspassed: 1 file, 59 tests.cbx_11c087803ec6, runrun_f4d2ea8c6456.OPENCLAW_TEST_FAST_CHILD=0skillsSnapshot.promptRefFIX_RESULT=passed-promptRef-present-second-repliedcbx_c94f033b0224, runrun_ff0d0c251602.OPENCLAW_TEST_FAST_CHILD=0skillsSnapshot.promptRefREPRO_RESULT=reproduced-promptRef-present-second-missingNote: an initial focused test command with
--runInBandfailed before tests ran because that Vitest option is unsupported by the repo wrapper; it was rerun with the supported command above and passed.