Skip to content

Commit 9fee9af

Browse files
committed
fix(skills): refresh persisted snapshots after restart
1 parent 01bf61f commit 9fee9af

3 files changed

Lines changed: 23 additions & 1 deletion

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Docs: https://docs.openclaw.ai
1414

1515
### Fixes
1616

17+
- Skills: seed the process-local skills snapshot version at gateway/CLI startup so persisted sessions refresh stale `version: 0` snapshots once after restart, picking up skills added while OpenClaw was offline. Fixes #69715, #55489, #54209, #49059, and #67459.
1718
- Browser/Playwright: ignore benign already-handled route races during guarded navigation so browser-page tasks no longer fail when Playwright tears down a route mid-flight. (#68708) Thanks @Steady-ai.
1819
- Telegram: prevent duplicate in-process long pollers for the same bot token and add clearer `getUpdates` conflict diagnostics for external duplicate pollers. Fixes #56230.
1920
- Browser/Linux: detect Chromium-based installs under `/opt/google`, `/opt/brave.com`, `/usr/lib/chromium`, and `/usr/lib/chromium-browser` before asking users to set `browser.executablePath`. (#48563) Thanks @lupuletic.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { describe, expect, it, vi } from "vitest";
2+
3+
describe("skills refresh state", () => {
4+
it("seeds a process-local version so persisted restart snapshots refresh once", async () => {
5+
vi.useFakeTimers();
6+
try {
7+
vi.setSystemTime(new Date("2026-04-25T12:00:00Z"));
8+
vi.resetModules();
9+
const refreshState = await import("./refresh-state.js");
10+
11+
const startupVersion = refreshState.getSkillsSnapshotVersion("/tmp/workspace");
12+
13+
expect(startupVersion).toBe(Date.parse("2026-04-25T12:00:00Z"));
14+
expect(refreshState.shouldRefreshSnapshotForVersion(0, startupVersion)).toBe(true);
15+
} finally {
16+
vi.useRealTimers();
17+
vi.resetModules();
18+
}
19+
});
20+
});

‎src/agents/skills/refresh-state.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export type SkillsChangeEvent = {
66

77
const listeners = new Set<(event: SkillsChangeEvent) => void>();
88
const workspaceVersions = new Map<string, number>();
9-
let globalVersion = 0;
9+
// Process-local: persisted snapshots from an older gateway run should refresh once after restart.
10+
let globalVersion = Date.now();
1011
let listenerErrorHandler: ((err: unknown) => void) | undefined;
1112

1213
function bumpVersion(current: number): number {

0 commit comments

Comments
 (0)