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

推荐订阅源

WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
MyScale Blog
MyScale Blog
博客园_首页
G
Google Developers Blog
博客园 - 【当耐特】
美团技术团队
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Vercel News
Vercel News
小众软件
小众软件
博客园 - 司徒正美
雷峰网
雷峰网
T
Tailwind CSS Blog
V
V2EX
博客园 - 三生石上(FineUI控件)
F
Fortinet All Blogs
罗磊的独立博客
量子位
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
月光博客
月光博客
A
About on SuperTechFans
Hugging Face - Blog
Hugging Face - Blog

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(gateway): track effective watcher polling mode · open...
vincentkoc · 2026-06-14 · via Recent Commits to openclaw:main

@@ -574,9 +574,11 @@ describe("resolveGatewayReloadSettings", () => {

574574

type WatcherHandler = () => void;

575575

type WatcherEvent = "add" | "change" | "unlink" | "error";

576576577-

function createWatcherMock() {

577+

function createWatcherMock(effectiveUsePolling?: boolean) {

578578

const handlers = new Map<WatcherEvent, WatcherHandler[]>();

579579

return {

580+

effectiveUsePolling,

581+

options: { usePolling: false },

580582

on(event: WatcherEvent, handler: WatcherHandler) {

581583

const existing = handlers.get(event) ?? [];

582584

existing.push(handler);

@@ -1602,9 +1604,15 @@ describe("startGatewayConfigReloader watcher error recovery", () => {

1602160416031605

function startReloaderWithWatchers(watchers: ReturnType<typeof createWatcherMock>[]) {

16041606

const watchSpy = vi.spyOn(chokidar, "watch");

1605-

for (const watcher of watchers) {

1606-

watchSpy.mockReturnValueOnce(watcher as unknown as never);

1607-

}

1607+

let watcherIndex = 0;

1608+

watchSpy.mockImplementation((_path, options) => {

1609+

const watcher = watchers[watcherIndex++];

1610+

if (!watcher) {

1611+

throw new Error("missing watcher mock");

1612+

}

1613+

watcher.options.usePolling = watcher.effectiveUsePolling ?? Boolean(options?.usePolling);

1614+

return watcher as unknown as never;

1615+

});

16081616

const log = { info: vi.fn(), warn: vi.fn(), error: vi.fn() };

16091617

const reloader = startGatewayConfigReloader({

16101618

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

@@ -1676,9 +1684,7 @@ describe("startGatewayConfigReloader watcher error recovery", () => {

16761684

// Fourth native error triggers degradation to polling mode (not disabled).

16771685

watchers[3]?.emit("error");

16781686

expect(reloader.hotReloadStatus()).toBe("active");

1679-

expect(log.warn).toHaveBeenCalledWith(

1680-

expect.stringContaining("degrading to polling mode"),

1681-

);

1687+

expect(log.warn).toHaveBeenCalledWith(expect.stringContaining("degrading to polling mode"));

16821688

await vi.advanceTimersByTimeAsync(500);

16831689

expect(watchSpy).toHaveBeenCalledTimes(5);

16841690

expect(watchOptions(4)?.usePolling).toBe(true);

@@ -1772,6 +1778,45 @@ describe("startGatewayConfigReloader watcher error recovery", () => {

17721778

}

17731779

});

177417801781+

it("uses chokidar's effective polling mode when the platform forces it on", async () => {

1782+

const originalVitest = process.env.VITEST;

1783+

const originalChokidarPolling = process.env.CHOKIDAR_USEPOLLING;

1784+

delete process.env.VITEST;

1785+

delete process.env.CHOKIDAR_USEPOLLING;

1786+

let reloader: { stop: () => Promise<void>; hotReloadStatus: () => string } | undefined;

1787+

try {

1788+

const watchers = Array.from({ length: 4 }, () => createWatcherMock(true));

1789+

const started = startReloaderWithWatchers(watchers);

1790+

const { log } = started;

1791+

reloader = started.reloader;

1792+

const backoffs = [500, 2000, 5000] as const;

1793+1794+

for (let index = 0; index < watchers.length - 1; index += 1) {

1795+

watchers[index]?.emit("error");

1796+

await vi.advanceTimersByTimeAsync(backoffs[index] ?? 0);

1797+

}

1798+

watchers.at(-1)?.emit("error");

1799+1800+

expect(reloader.hotReloadStatus()).toBe("disabled");

1801+

expect(log.warn).not.toHaveBeenCalledWith(

1802+

expect.stringContaining("degrading to polling mode"),

1803+

);

1804+

expect(log.error).toHaveBeenCalledWith(expect.stringContaining("in polling mode"));

1805+

} finally {

1806+

if (originalVitest === undefined) {

1807+

delete process.env.VITEST;

1808+

} else {

1809+

process.env.VITEST = originalVitest;

1810+

}

1811+

if (originalChokidarPolling === undefined) {

1812+

delete process.env.CHOKIDAR_USEPOLLING;

1813+

} else {

1814+

process.env.CHOKIDAR_USEPOLLING = originalChokidarPolling;

1815+

}

1816+

await reloader?.stop();

1817+

}

1818+

});

1819+17751820

it("does not report polling fallback when chokidar polling is forced off", async () => {

17761821

const originalVitest = process.env.VITEST;

17771822

const originalChokidarPolling = process.env.CHOKIDAR_USEPOLLING;