惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
雷峰网
雷峰网
博客园_首页
WordPress大学
WordPress大学
博客园 - 司徒正美
爱范儿
爱范儿
博客园 - 聂微东
IT之家
IT之家
美团技术团队
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
博客园 - Franky
V
V2EX
GbyAI
GbyAI
阮一峰的网络日志
阮一峰的网络日志

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(skills): bound watcher workspace state · openclaw/ope...
fede-kamel · 2026-06-01 · via Recent Commits to openclaw:main

@@ -657,6 +657,7 @@ describe("ensureSkillsWatcher", () => {

657657

workspaceDir: "/tmp/ws-a",

658658

config: { skills: { load: { extraDirs: ["/tmp/shared"], watch: false } } },

659659

});

660+

seen.length = 0;

660661661662

const callPaths = (watchMock.mock.calls as unknown as Array<[string]>).map((call) => call[0]);

662663

const sharedIndex = callPaths.findIndex((target) => target.includes("/tmp/shared"));

@@ -673,6 +674,99 @@ describe("ensureSkillsWatcher", () => {

673674

expect(seen.some((change) => change.workspaceDir === "/tmp/ws-a")).toBe(false);

674675

});

675676677+

it("clears workspace version state on watch disable without losing pending invalidation", () => {

678+

vi.useFakeTimers();

679+

vi.setSystemTime(new Date("2026-01-01T00:00:00Z"));

680+

const workspaceDir = "/tmp/workspace-version-cleanup";

681+

refreshModule.ensureSkillsWatcher({

682+

workspaceDir,

683+

config: { skills: { load: { watchDebounceMs: 10 } } },

684+

});

685+686+

const firstVersion = refreshModule.bumpSkillsSnapshotVersion({

687+

workspaceDir,

688+

reason: "watch",

689+

changedPath: `${workspaceDir}/skills/demo/SKILL.md`,

690+

});

691+

refreshModule.ensureSkillsWatcher({

692+

workspaceDir,

693+

config: { skills: { load: { watch: false } } },

694+

});

695+696+

const nextVersion = refreshModule.getSkillsSnapshotVersion(workspaceDir);

697+

expect(nextVersion).toBeGreaterThan(firstVersion);

698+

expect(refreshModule.shouldRefreshSnapshotForVersion(firstVersion, nextVersion)).toBe(true);

699+

vi.setSystemTime(new Date(nextVersion));

700+

const followupVersion = refreshModule.bumpSkillsSnapshotVersion({

701+

workspaceDir,

702+

reason: "watch",

703+

});

704+

expect(followupVersion).toBeGreaterThan(nextVersion);

705+

});

706+707+

it("evicts idle workspace subscriptions on a later ensure call", () => {

708+

vi.useFakeTimers();

709+

vi.setSystemTime(new Date("2026-01-01T00:00:00Z"));

710+

const idleWorkspaceDir = "/tmp/workspace-idle";

711+

refreshModule.ensureSkillsWatcher({

712+

workspaceDir: idleWorkspaceDir,

713+

config: { skills: { load: { watchDebounceMs: 10 } } },

714+

});

715+

const callPaths = (watchMock.mock.calls as unknown as Array<[string]>).map((call) => call[0]);

716+

const idleSkillsIndex = callPaths.findIndex(

717+

(target) => target === `${idleWorkspaceDir}/skills`,

718+

);

719+

expect(idleSkillsIndex).toBeGreaterThanOrEqual(0);

720+

const firstVersion = refreshModule.bumpSkillsSnapshotVersion({

721+

workspaceDir: idleWorkspaceDir,

722+

reason: "watch",

723+

});

724+725+

vi.advanceTimersByTime(60 * 60_000 + 1_000);

726+

refreshModule.ensureSkillsWatcher({

727+

workspaceDir: "/tmp/workspace-active",

728+

config: { skills: { load: { watchDebounceMs: 10 } } },

729+

});

730+731+

expect(createdWatchers[idleSkillsIndex]?.close).toHaveBeenCalledTimes(1);

732+

const evictedVersion = refreshModule.getSkillsSnapshotVersion(idleWorkspaceDir);

733+

expect(evictedVersion).toBeGreaterThan(firstVersion);

734+

expect(refreshModule.shouldRefreshSnapshotForVersion(firstVersion, evictedVersion)).toBe(true);

735+

vi.setSystemTime(new Date(evictedVersion));

736+

const followupVersion = refreshModule.bumpSkillsSnapshotVersion({

737+

workspaceDir: idleWorkspaceDir,

738+

});

739+

expect(followupVersion).toBeGreaterThan(evictedVersion);

740+

});

741+742+

it("keeps refreshed workspace subscriptions within the idle TTL", () => {

743+

vi.useFakeTimers();

744+

vi.setSystemTime(new Date("2026-01-01T00:00:00Z"));

745+

const activeWorkspaceDir = "/tmp/workspace-active-refresh";

746+

refreshModule.ensureSkillsWatcher({

747+

workspaceDir: activeWorkspaceDir,

748+

config: { skills: { load: { watchDebounceMs: 10 } } },

749+

});

750+

const callPaths = (watchMock.mock.calls as unknown as Array<[string]>).map((call) => call[0]);

751+

const activeSkillsIndex = callPaths.findIndex(

752+

(target) => target === `${activeWorkspaceDir}/skills`,

753+

);

754+

expect(activeSkillsIndex).toBeGreaterThanOrEqual(0);

755+756+

vi.advanceTimersByTime(30 * 60_000);

757+

refreshModule.ensureSkillsWatcher({

758+

workspaceDir: activeWorkspaceDir,

759+

config: { skills: { load: { watchDebounceMs: 10 } } },

760+

});

761+

vi.advanceTimersByTime(31 * 60_000);

762+

refreshModule.ensureSkillsWatcher({

763+

workspaceDir: "/tmp/workspace-other",

764+

config: { skills: { load: { watchDebounceMs: 10 } } },

765+

});

766+767+

expect(createdWatchers[activeSkillsIndex]?.close).not.toHaveBeenCalled();

768+

});

769+676770

it("rebuilds a shared watcher with last-writer debounce while preserving subscribers", async () => {

677771

vi.useFakeTimers();

678772

const seen: SkillsChangeEvent[] = [];