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

推荐订阅源

钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MongoDB | Blog
MongoDB | Blog
博客园_首页
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
B
Blog RSS Feed
D
Docker
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
罗磊的独立博客
Recent Announcements
Recent Announcements
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
A
About on SuperTechFans
The GitHub Blog
The GitHub Blog
G
Google Developers Blog
V
V2EX
量子位
雷峰网
雷峰网
月光博客
月光博客
云风的 BLOG
云风的 BLOG
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS 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(agents): collapse local model timeout knobs · opencla...
steipete · 2026-04-27 · via Recent Commits to openclaw:main

@@ -11,45 +11,11 @@ describe("resolveLlmIdleTimeoutMs", () => {

1111

expect(resolveLlmIdleTimeoutMs()).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

1212

});

131314-

it("returns default when llm config is missing", () => {

14+

it("returns default when agent defaults are missing", () => {

1515

const cfg = { agents: {} } as OpenClawConfig;

1616

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

1717

});

181819-

it("returns default when idleTimeoutSeconds is not set", () => {

20-

const cfg = { agents: { defaults: { llm: {} } } } as OpenClawConfig;

21-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

22-

});

23-24-

it("returns 0 when idleTimeoutSeconds is 0 (disabled)", () => {

25-

const cfg = { agents: { defaults: { llm: { idleTimeoutSeconds: 0 } } } } as OpenClawConfig;

26-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(0);

27-

});

28-29-

it("returns configured value in milliseconds", () => {

30-

const cfg = { agents: { defaults: { llm: { idleTimeoutSeconds: 30 } } } } as OpenClawConfig;

31-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(30_000);

32-

});

33-34-

it("caps at max safe timeout", () => {

35-

const cfg = {

36-

agents: { defaults: { llm: { idleTimeoutSeconds: 10_000_000 } } },

37-

} as OpenClawConfig;

38-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(2_147_000_000);

39-

});

40-41-

it("ignores negative values", () => {

42-

const cfg = { agents: { defaults: { llm: { idleTimeoutSeconds: -10 } } } } as OpenClawConfig;

43-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

44-

});

45-46-

it("ignores non-finite values", () => {

47-

const cfg = {

48-

agents: { defaults: { llm: { idleTimeoutSeconds: Infinity } } },

49-

} as OpenClawConfig;

50-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

51-

});

52-5319

it("caps agents.defaults.timeoutSeconds fallback at the default idle watchdog", () => {

5420

const cfg = { agents: { defaults: { timeoutSeconds: 300 } } } as OpenClawConfig;

5521

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

@@ -72,43 +38,53 @@ describe("resolveLlmIdleTimeoutMs", () => {

7238

expect(resolveLlmIdleTimeoutMs({ runTimeoutMs: 2_147_000_000 })).toBe(0);

7339

});

744075-

it("prefers llm.idleTimeoutSeconds over agents.defaults.timeoutSeconds", () => {

76-

const cfg = {

77-

agents: { defaults: { timeoutSeconds: 300, llm: { idleTimeoutSeconds: 120 } } },

78-

} as OpenClawConfig;

79-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(120_000);

41+

it("uses the provider request timeout as the model idle watchdog", () => {

42+

expect(resolveLlmIdleTimeoutMs({ modelRequestTimeoutMs: 300_000 })).toBe(300_000);

8043

});

814482-

it("prefers llm.idleTimeoutSeconds over an explicit run timeout override", () => {

83-

const cfg = {

84-

agents: { defaults: { llm: { idleTimeoutSeconds: 120 } } },

85-

} as OpenClawConfig;

86-

expect(resolveLlmIdleTimeoutMs({ cfg, runTimeoutMs: 900_000 })).toBe(120_000);

45+

it("caps provider request timeout at the max safe timeout", () => {

46+

expect(resolveLlmIdleTimeoutMs({ modelRequestTimeoutMs: 10_000_000_000 })).toBe(2_147_000_000);

8747

});

884889-

it("keeps idleTimeoutSeconds=0 disabled even when timeoutSeconds is set", () => {

49+

it("ignores invalid provider request timeout values", () => {

50+

expect(resolveLlmIdleTimeoutMs({ modelRequestTimeoutMs: -1 })).toBe(

51+

DEFAULT_LLM_IDLE_TIMEOUT_MS,

52+

);

53+

expect(resolveLlmIdleTimeoutMs({ modelRequestTimeoutMs: Infinity })).toBe(

54+

DEFAULT_LLM_IDLE_TIMEOUT_MS,

55+

);

56+

});

57+58+

it("bounds provider request timeout by agents.defaults.timeoutSeconds when shorter", () => {

9059

const cfg = {

91-

agents: { defaults: { timeoutSeconds: 300, llm: { idleTimeoutSeconds: 0 } } },

60+

agents: { defaults: { timeoutSeconds: 45 } },

9261

} as OpenClawConfig;

93-

expect(resolveLlmIdleTimeoutMs({ cfg })).toBe(0);

62+

expect(resolveLlmIdleTimeoutMs({ cfg, modelRequestTimeoutMs: 300_000 })).toBe(45_000);

63+

});

64+65+

it("bounds provider request timeout by explicit run timeout when shorter", () => {

66+

expect(resolveLlmIdleTimeoutMs({ modelRequestTimeoutMs: 300_000, runTimeoutMs: 45_000 })).toBe(

67+

45_000,

68+

);

69+

});

70+71+

it("uses provider request timeout for cron model calls", () => {

72+

expect(resolveLlmIdleTimeoutMs({ trigger: "cron", modelRequestTimeoutMs: 300_000 })).toBe(

73+

300_000,

74+

);

9475

});

95769677

it("disables the default idle timeout for cron when no timeout is configured", () => {

9778

expect(resolveLlmIdleTimeoutMs({ trigger: "cron" })).toBe(0);

987999-

const cfg = { agents: { defaults: { llm: {} } } } as OpenClawConfig;

80+

const cfg = { agents: { defaults: {} } } as OpenClawConfig;

10081

expect(resolveLlmIdleTimeoutMs({ cfg, trigger: "cron" })).toBe(0);

10182

});

1028310384

it("caps agents.defaults.timeoutSeconds for cron before disabling the default idle timeout", () => {

10485

const cfg = { agents: { defaults: { timeoutSeconds: 300 } } } as OpenClawConfig;

10586

expect(resolveLlmIdleTimeoutMs({ cfg, trigger: "cron" })).toBe(DEFAULT_LLM_IDLE_TIMEOUT_MS);

10687

});

107-108-

it("keeps an explicit cron idle timeout when configured", () => {

109-

const cfg = { agents: { defaults: { llm: { idleTimeoutSeconds: 45 } } } } as OpenClawConfig;

110-

expect(resolveLlmIdleTimeoutMs({ cfg, trigger: "cron" })).toBe(45_000);

111-

});

11288

});

1138911490

describe("streamWithIdleTimeout", () => {