File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -316,12 +316,14 @@ async function executeStep(
316316 // timeout 策略:
317317 // - 用户显式设置(含 timeout: 0 表示不限时)→ 第一次按此值
318318 // - 未设置 → provider 默认(API 120s / CLI/ollama 600s)
319- // - 因超时触发 retry 时,下一轮 timeout x1.5(上限 900s )
319+ // - 因超时触发 retry 时,下一轮 timeout x1.5(上限 3600s / 60min )
320320 // 非超时类错误(429/500/ECONNRESET 等)保持原 timeout,避免无谓放大
321+ // - 上限是防误配置放飞的保险丝(retry 10 次可能放大到几十小时),
322+ // 真要超过 1 小时单步请用 timeout: 0 / --timeout 0 完全不限时
321323 const defaultTimeout = effectiveIsCLI ? 600_000 : effectiveIsLocal ? 600_000 : 120_000 ;
322324 const baseTimeout = effectiveConfig . timeout !== undefined ? effectiveConfig . timeout : defaultTimeout ;
323325 const effectiveMaxRetry = effectiveConfig . retry ?? opts . maxRetry ;
324- const TIMEOUT_CAP = 900_000 ;
326+ const TIMEOUT_CAP = 3_600_000 ;
325327
326328 // 带重试的 LLM 调用(timeout 在网络超时类错误重试时自动延长)
327329 let lastError : Error | null = null ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export interface LLMConfig {
1717 model ?: string ; // CLI providers 可省略(使用 CLI 默认模型)
1818 agent ?: string ; // openclaw-cli 专用:agent ID(默认 "main")
1919 max_tokens ?: number ; // 默认 4096
20- timeout ?: number ; // 单步超时 ms。默认 API 120000 / CLI 600000 / ollama 600000。因超时触发重试时,下一次 timeout 自动 x1.5(上限 900000 )。设为 0 表示不限时
20+ timeout ?: number ; // 单步超时 ms。默认 API 120000 / CLI 600000 / ollama 600000。因超时触发重试时,下一次 timeout 自动 x1.5(上限 3600000 / 60min )。设为 0 表示不限时
2121 retry ?: number ; // 失败重试次数,默认 3
2222}
2323
You can’t perform that action at this time.
0 commit comments