Repository navigation
fix(skills): refresh stale session skill snapshots after restart - #69716
JinluZhang wants to merge 1 commit into
Conversation
Greptile SummaryThis PR fixes a stale-session edge case by (1) bumping the per-workspace skills snapshot version to a non-zero value the first time a watcher is attached and (2) reading that version after Confidence Score: 4/5Production fix is sound but the new regression test needs a mock correction before the suite will pass. The core logic change (ordering + initial version seeding) is correct and well-reasoned. The P1 finding is confined to the test: src/auto-reply/reply/session-updates.test.ts — mock for
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b60d3f59d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| ensureSkillsWatcherMock.mockImplementation(() => { | ||
| getSkillsSnapshotVersionMock.mockReturnValue(123); | ||
| }); |
There was a problem hiding this comment.
Mock refresh-state for snapshot-version assertion
ensureSkillSnapshot reads getSkillsSnapshotVersion from src/agents/skills/refresh-state.js, so changing getSkillsSnapshotVersionMock inside ensureSkillsWatcherMock here does not affect the value used by production code. In this test path (OPENCLAW_TEST_FAST=0), the snapshot version stays at the real default (0), so the new expectation for snapshotVersion: 123 fails deterministically instead of validating the intended ordering behavior.
Useful? React with 👍 / 👎.
|
Thanks @JinluZhang. This found the right failure mode: persisted skills snapshots can stay at I opened the canonical maintainer PR at #71497. It keeps the same root-cause fix, but moves the version seed into the shared skills refresh-state layer so both the gateway reply path and the CLI Closing this as superseded/duplicate so the cluster has one merge target. Your contribution is referenced from the canonical PR. |
Summary
Fixes a stale-session edge case where newly added skills can stay invisible after a gateway restart.
Fixes #69715.
What Changed
snapshotVersionafterensureSkillsWatcher()inensureSkillSnapshot()Why
A persisted session snapshot with
version = 0could compare equal to the fresh process state after restart, so the next turn would skip rebuilding the snapshot. In practice that let existing sessions miss newly added workspace skills until the session was reset or otherwise refreshed.Testing
git diff --checksrc/agents/skills/refresh.test.tssrc/auto-reply/reply/session-updates.test.tsnode_modules,vitest, orpnpminstalled, sonode scripts/run-vitest.mjs ...fails withCannot find module 'vitest/package.json'.