openclaw - 💡(How to fix) Fix [Bug]: Gateway startup pricing fetch fails despite network being available — OpenRouter TypeError + LiteLLM 60s timeout on Windows 11 [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#74178Fetched 2026-04-30 06:27:45
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Author
Timeline (top)
closed ×1commented ×1cross-referenced ×1

Gateway 启动时,model pricing fetch 总是失败,导致启动变慢。OpenRouter 报 TypeError: fetch failed,LiteLLM 报 TimeoutError: 60s timeout。但本地网络和 openclaw agent 都能正常访问这些端点——说明不是网络不可达的问题,而是 gateway 进程内的 fetch 存在某种特殊限制。

Error Message

14:42:36 [gateway] starting channels and sidecars...
14:43:05 [model-pricing] OpenRouter pricing fetch failed: TypeError: fetch failed
14:44:02 [ws] handshake timeout conn=b99f849b...
14:44:03 [model-pricing] LiteLLM pricing fetch failed (timeout 60s): TimeoutError: The operation was aborted due to timeout
14:44:52 [heartbeat] disabled

Root Cause

Gateway 启动时,model pricing fetch 总是失败,导致启动变慢。OpenRouter 报 TypeError: fetch failed,LiteLLM 报 TimeoutError: 60s timeout。但本地网络和 openclaw agent 都能正常访问这些端点——说明不是网络不可达的问题,而是 gateway 进程内的 fetch 存在某种特殊限制。

Code Example

14:42:36 [gateway] starting channels and sidecars...
14:43:05 [model-pricing] OpenRouter pricing fetch failed: TypeError: fetch failed
14:44:02 [ws] handshake timeout conn=b99f849b...
14:44:03 [model-pricing] LiteLLM pricing fetch failed (timeout 60s): TimeoutError: The operation was aborted due to timeout
14:44:52 [heartbeat] disabled
RAW_BUFFERClick to expand / collapse

Summary

Gateway 启动时,model pricing fetch 总是失败,导致启动变慢。OpenRouter 报 TypeError: fetch failed,LiteLLM 报 TimeoutError: 60s timeout。但本地网络和 openclaw agent 都能正常访问这些端点——说明不是网络不可达的问题,而是 gateway 进程内的 fetch 存在某种特殊限制。

Environment

  • OS: Windows 11 Pro (China Only), 10.0.26200
  • Node: (Node 24.x)
  • openclaw version: 2026.4.24 (commit cbcfdf6) / 2026.4.26

Logs

14:42:36 [gateway] starting channels and sidecars...
14:43:05 [model-pricing] OpenRouter pricing fetch failed: TypeError: fetch failed
14:44:02 [ws] handshake timeout conn=b99f849b...
14:44:03 [model-pricing] LiteLLM pricing fetch failed (timeout 60s): TimeoutError: The operation was aborted due to timeout
14:44:52 [heartbeat] disabled

Key observations

  1. OpenRouter 很快失败 (TypeError: fetch failed),不像网络超时,更像连接被拒绝或 DNS 解析失败。
  2. LiteLLM 每次都等到 60s 超时(GitHub raw URL)。
  3. 本地机器能正常访问这两个端点——浏览器、curl 都没问题。
  4. openclaw 的 agent 进程也能正常访问 GitHub——agent 可以正常 fetch GitHub 内容。
  5. 唯独 gateway 进程内的 pricing fetch 失败——说明问题不在网络层面,而在 gateway 进程的 HTTP 客户端或时序上。

分析

这与 issue #65164(All outbound HTTP fails inside gateway process on Windows)的症状类似。gateway 进程和 agent 进程之间的网络行为存在差异。可能的原因:

  • Gateway 进程的 Node.js fetch 在 Windows 上使用了不同的 HTTP 栈或 resolver
  • Pricing fetch 在 gateway 启动的早期阶段触发,此时某些网络基础设施(如代理设置、DNS 缓存)尚未就绪
  • Windows 上的 Node.js global fetch 在某些条件下无法正确连接

Additional context

  • 我没有配置 OpenRouter 或 LiteLLM provider——使用的只是 Anthropic 原生模型
  • collectConfiguredModelPricingRefs 扫描到配置中有模型引用(默认模型)后就无条件同时请求两个 pricing 源
  • 即使这两个 pricing 源都失败,gateway 仍然能正常启动和工作——说明 price 数据不是必须的
  • 希望 pricing fetch 至少能做到:(1) lazy/fail-fast 而非阻塞,(2) 增加 skip 配置选项,#59348 #73124 等已提出

extent analysis

TL;DR

The gateway process's pricing fetch is failing due to a potential issue with Node.js fetch on Windows, and a workaround may involve configuring the fetch to be lazy or adding a skip option.

Guidance

  • Investigate the difference in network behavior between the gateway process and the agent process, as hinted by the similarity with issue #65164.
  • Consider configuring the pricing fetch to be lazy or fail-fast, rather than blocking, to prevent startup delays.
  • Look into adding a skip configuration option for pricing fetch, as proposed in issues #59348 and #73124, to allow for more flexibility.
  • Verify that the issue is not related to the specific models or providers being used, by testing with different configurations.

Example

No code snippet is provided due to the lack of specific implementation details in the issue.

Notes

The issue seems to be specific to the Windows environment and Node.js version, and may not be reproducible on other platforms. Further investigation is needed to determine the root cause and a permanent fix.

Recommendation

Apply a workaround by configuring the pricing fetch to be lazy or adding a skip option, as this may help mitigate the issue and prevent startup delays.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING