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

推荐订阅源

T
Tailwind CSS Blog
人人都是产品经理
人人都是产品经理
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 【当耐特】
The Cloudflare Blog
博客园 - 聂微东
博客园 - 司徒正美
量子位
博客园 - 三生石上(FineUI控件)
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
Y
Y Combinator Blog
S
SegmentFault 最新的问题
T
The Blog of Author Tim Ferriss
P
Proofpoint News Feed
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
有赞技术团队
有赞技术团队
A
About on SuperTechFans

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 test: merge chat context notice checks · openclaw/openclaw@5c2f4af 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
Gateway/skills: invalidate session skills snapshot on con...
2026-04-16 · via Recent Commits to openclaw:main

@@ -2,13 +2,18 @@ import chokidar from "chokidar";

22

import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

33

import { listChannelPlugins } from "../channels/plugins/index.js";

44

import type { ChannelPlugin } from "../channels/plugins/types.js";

5+

import {

6+

getSkillsSnapshotVersion,

7+

resetSkillsRefreshStateForTest,

8+

} from "../agents/skills/refresh-state.js";

59

import type { ConfigFileSnapshot, ConfigWriteNotification } from "../config/config.js";

610

import { setActivePluginRegistry } from "../plugins/runtime.js";

711

import { createTestRegistry } from "../test-utils/channel-plugins.js";

812

import {

913

buildGatewayReloadPlan,

1014

diffConfigPaths,

1115

resolveGatewayReloadSettings,

16+

shouldInvalidateSkillsSnapshotForPaths,

1217

startGatewayConfigReloader,

1318

} from "./config-reload.js";

1419

@@ -616,3 +621,98 @@ describe("startGatewayConfigReloader", () => {

616621

await harness.reloader.stop();

617622

});

618623

});

624+625+

describe("shouldInvalidateSkillsSnapshotForPaths", () => {

626+

it.each([

627+

"skills",

628+

"skills.allowBundled",

629+

"skills.entries",

630+

"skills.entries.himalaya",

631+

"skills.entries.himalaya.enabled",

632+

"skills.profile",

633+

])("returns true for skills path %s", (path) => {

634+

expect(shouldInvalidateSkillsSnapshotForPaths([path])).toBe(true);

635+

});

636+637+

it.each([

638+

"tools.profile",

639+

"agents.defaults.model",

640+

"gateway.port",

641+

"skillset.allowBundled",

642+

"channels.telegram.enabled",

643+

])("returns false for unrelated path %s", (path) => {

644+

expect(shouldInvalidateSkillsSnapshotForPaths([path])).toBe(false);

645+

});

646+647+

it("returns true when any path in the list matches", () => {

648+

expect(

649+

shouldInvalidateSkillsSnapshotForPaths([

650+

"gateway.port",

651+

"skills.allowBundled",

652+

"channels.telegram.enabled",

653+

]),

654+

).toBe(true);

655+

});

656+657+

it("returns false for empty input", () => {

658+

expect(shouldInvalidateSkillsSnapshotForPaths([])).toBe(false);

659+

});

660+

});

661+662+

describe("startGatewayConfigReloader skills invalidation", () => {

663+

beforeEach(() => {

664+

vi.useFakeTimers();

665+

resetSkillsRefreshStateForTest();

666+

});

667+668+

afterEach(() => {

669+

vi.useRealTimers();

670+

vi.restoreAllMocks();

671+

resetSkillsRefreshStateForTest();

672+

});

673+674+

it("bumps the skills snapshot version when skills.allowBundled changes", async () => {

675+

const before = getSkillsSnapshotVersion();

676+

const readSnapshot = vi.fn<() => Promise<ConfigFileSnapshot>>().mockResolvedValueOnce(

677+

makeSnapshot({

678+

config: {

679+

gateway: { reload: { debounceMs: 0 } },

680+

skills: { allowBundled: ["gog"] },

681+

},

682+

hash: "skills-change-1",

683+

}),

684+

);

685+

const { watcher, log, reloader } = createReloaderHarness(readSnapshot);

686+687+

watcher.emit("change");

688+

await vi.runOnlyPendingTimersAsync();

689+690+

const after = getSkillsSnapshotVersion();

691+

expect(after).toBeGreaterThan(before);

692+

expect(log.info).toHaveBeenCalledWith(

693+

expect.stringContaining("skills snapshot invalidated by config change"),

694+

);

695+696+

await reloader.stop();

697+

});

698+699+

it("does not bump the snapshot version when unrelated config changes", async () => {

700+

const before = getSkillsSnapshotVersion();

701+

const readSnapshot = vi.fn<() => Promise<ConfigFileSnapshot>>().mockResolvedValueOnce(

702+

makeSnapshot({

703+

config: {

704+

gateway: { reload: { debounceMs: 0 }, port: 18790 },

705+

},

706+

hash: "unrelated-change-1",

707+

}),

708+

);

709+

const { watcher, reloader } = createReloaderHarness(readSnapshot);

710+711+

watcher.emit("change");

712+

await vi.runOnlyPendingTimersAsync();

713+714+

expect(getSkillsSnapshotVersion()).toBe(before);

715+716+

await reloader.stop();

717+

});

718+

});