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

推荐订阅源

IT之家
IT之家
Y
Y Combinator Blog
T
Tailwind CSS Blog
G
Google Developers Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 聂微东
爱范儿
爱范儿
博客园 - 【当耐特】
腾讯CDC
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
M
MIT News - Artificial intelligence
博客园_首页
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
Engineering at Meta
Engineering at Meta
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

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(qqbot): derive outbound watchdog from configured time...
clawsweeper · 2026-05-25 · via Recent Commits to openclaw:main
1+

/**

2+

* QQBot outbound response watchdog timeout resolver.

3+

*

4+

* Background — issue #85267:

5+

* The reporter ran openclaw + ollama + `qwen3.5:27b` (a slow local model)

6+

* with `models.providers.ollama.timeoutSeconds: 1800` and saw the

7+

* QQBot reply path abort at ~5 minutes with "LLM request timed out",

8+

* despite the direct ollama call to the same model working. The

9+

* embedded-runner / idle-timeout layer already honors longer

10+

* provider timeouts (see `src/agents/pi-embedded-runner/run/llm-idle-timeout.ts`),

11+

* but the QQBot outbound dispatcher held an independent hardcoded

12+

* `RESPONSE_TIMEOUT = 300_000` watchdog that quietly undercut the

13+

* configured ceiling.

14+

*

15+

* Fix shape (clawsweeper `clawsweeper:fix-shape-clear`):

16+

* Don't add a new QQBot-only knob. Instead derive the QQBot wait

17+

* budget from the existing agent/provider timeout settings the user

18+

* already configured:

19+

* - `agents.defaults.timeoutSeconds`

20+

* - `models.providers.<id>.timeoutSeconds` (max across configured providers)

21+

* Take the maximum and clamp to `[DEFAULT_RESPONSE_TIMEOUT_MS, MAX_SAFE_TIMEOUT_MS]`.

22+

* The default floor preserves the existing 5-minute guard for users

23+

* that have not configured any longer ceiling — i.e. a no-op for

24+

* typical cloud-model deployments.

25+

*/

26+27+

/**

28+

* Default QQBot outbound response watchdog when no config override is

29+

* present. Preserves the historical 5-minute guard for unconfigured

30+

* deployments.

31+

*/

32+

export const DEFAULT_RESPONSE_TIMEOUT_MS = 300_000;

33+34+

/**

35+

* Upper bound to keep the watchdog inside the safe `setTimeout` range

36+

* (approximately 24.8 days). Mirrors `MAX_SAFE_TIMEOUT_MS` in

37+

* `src/agents/pi-embedded-runner/run/llm-idle-timeout.ts`.

38+

*/

39+

const MAX_SAFE_TIMEOUT_MS = 2_147_000_000;

40+41+

interface AgentsDefaultsLike {

42+

timeoutSeconds?: unknown;

43+

}

44+45+

interface AgentsBlockLike {

46+

defaults?: AgentsDefaultsLike;

47+

}

48+49+

interface ProviderEntryLike {

50+

timeoutSeconds?: unknown;

51+

}

52+53+

interface ModelsBlockLike {

54+

providers?: Record<string, ProviderEntryLike | undefined> | undefined;

55+

}

56+57+

interface CfgShape {

58+

agents?: AgentsBlockLike;

59+

models?: ModelsBlockLike;

60+

}

61+62+

function positiveSecondsToMs(value: unknown): number | undefined {

63+

if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {

64+

return undefined;

65+

}

66+

return Math.floor(value * 1000);

67+

}

68+69+

/**

70+

* Resolve the QQBot outbound response watchdog (ms).

71+

*

72+

* The watchdog is the longest of:

73+

* - `DEFAULT_RESPONSE_TIMEOUT_MS` (5 min, historical floor)

74+

* - `cfg.agents.defaults.timeoutSeconds` converted to ms

75+

* - the maximum `cfg.models.providers.<id>.timeoutSeconds` across

76+

* configured providers, converted to ms

77+

*

78+

* Returns at most `MAX_SAFE_TIMEOUT_MS` so the chosen value is always

79+

* a safe `setTimeout` argument.

80+

*/

81+

export function resolveResponseTimeoutMs(cfg: unknown): number {

82+

const candidates: number[] = [DEFAULT_RESPONSE_TIMEOUT_MS];

83+84+

const typed = (cfg ?? {}) as CfgShape;

85+86+

const agentDefaultMs = positiveSecondsToMs(typed.agents?.defaults?.timeoutSeconds);

87+

if (agentDefaultMs !== undefined) {

88+

candidates.push(agentDefaultMs);

89+

}

90+91+

const providers = typed.models?.providers;

92+

if (providers && typeof providers === "object") {

93+

for (const entry of Object.values(providers)) {

94+

const providerMs = positiveSecondsToMs(entry?.timeoutSeconds);

95+

if (providerMs !== undefined) {

96+

candidates.push(providerMs);

97+

}

98+

}

99+

}

100+101+

const chosen = Math.max(...candidates);

102+

return Math.min(chosen, MAX_SAFE_TIMEOUT_MS);

103+

}