openclaw - 💡(How to fix) Fix openclaw infer embedding create fails with TypeError: fetch failed on Node 24 despite valid Voyage credential; underlying cause is swallowed [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#73713Fetched 2026-04-29 06:16:04
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

Error Message

  • openclaw infer embedding create --provider voyage --text 'probe' --json exits with only TypeError: fetch failed.\n- NODE_OPTIONS='--dns-result-order=ipv4first' does not change the failure.\n- OPENCLAW_DEBUG_MEMORY_EMBEDDINGS=1 does not add useful output; it still exits with only TypeError: fetch failed.\n- Gateway logs also show provider fetch failures such as OpenRouter pricing fetch failures.\n\nImportant diagnostic:\n- Passing OpenClaw runtime [email protected] Agent to Node 24 global fetch reproduces InvalidArgumentError: invalid onRequestStart method, code UND_ERR_INVALID_ARG.\n- However, the installed fetchWithSsrFGuard appears to route dispatcher calls through bundled runtime undici.fetch, and direct guarded Voyage controls succeed.\n- So the embedding CLI failure may be from a provider path that bypasses that runtime-fetch fallback, passes a custom fetchImpl, or otherwise loses the underlying cause.\n\nExpected:\n- Embedding CLI should succeed when the same key/request succeeds through direct fetch and guarded fetch.\n- If fetch fails, CLI should surface error.cause / UND_ERR_* details instead of only TypeError: fetch failed.\n\nAsk:\n- Please audit the infer embedding create / Voyage provider path for any global-fetch + runtime-dispatcher mixing or custom fetchImpl path.\n- Please preserve/log the underlying fetch cause for provider embedding failures.

Fix Action

Fix / Workaround

Observed:

  • Direct Node fetch to Voyage embeddings with VOYAGE_API_KEY returns HTTP 200 and 1024-dim vectors.
  • openclaw infer embedding create --provider voyage --text 'probe' --json exits with only TypeError: fetch failed.\n- NODE_OPTIONS='--dns-result-order=ipv4first' does not change the failure.\n- OPENCLAW_DEBUG_MEMORY_EMBEDDINGS=1 does not add useful output; it still exits with only TypeError: fetch failed.\n- Gateway logs also show provider fetch failures such as OpenRouter pricing fetch failures.\n\nImportant diagnostic:\n- Passing OpenClaw runtime [email protected] Agent to Node 24 global fetch reproduces InvalidArgumentError: invalid onRequestStart method, code UND_ERR_INVALID_ARG.\n- However, the installed fetchWithSsrFGuard appears to route dispatcher calls through bundled runtime undici.fetch, and direct guarded Voyage controls succeed.\n- So the embedding CLI failure may be from a provider path that bypasses that runtime-fetch fallback, passes a custom fetchImpl, or otherwise loses the underlying cause.\n\nExpected:\n- Embedding CLI should succeed when the same key/request succeeds through direct fetch and guarded fetch.\n- If fetch fails, CLI should surface error.cause / UND_ERR_* details instead of only TypeError: fetch failed.\n\nAsk:\n- Please audit the infer embedding create / Voyage provider path for any global-fetch + runtime-dispatcher mixing or custom fetchImpl path.\n- Please preserve/log the underlying fetch cause for provider embedding failures.
RAW_BUFFERClick to expand / collapse

Environment:

  • OpenClaw 2026.4.26 (be8c246)
  • Node v24.14.1
  • macOS / launchd gateway
  • Runtime deps include top-level [email protected]

Relevant bundle artifacts:

  • dist/embedding-provider-gC07tS5j.js - 63 lines, sha256 739a2dd8587959f11d594b3af99b083b060577716295e4ab7c71aec15c8cb003
  • dist/memory-core-host-engine-embeddings-r1-dacIT.js - 461 lines, sha256 4d80fff73c1759cb319705f3193b859b7629aff5a4afc834c4aa43f316155b63
  • postJson starts at memory-core-host-engine-embeddings-r1-dacIT.js:112

Observed:

  • Direct Node fetch to Voyage embeddings with VOYAGE_API_KEY returns HTTP 200 and 1024-dim vectors.
  • openclaw infer embedding create --provider voyage --text 'probe' --json exits with only TypeError: fetch failed.\n- NODE_OPTIONS='--dns-result-order=ipv4first' does not change the failure.\n- OPENCLAW_DEBUG_MEMORY_EMBEDDINGS=1 does not add useful output; it still exits with only TypeError: fetch failed.\n- Gateway logs also show provider fetch failures such as OpenRouter pricing fetch failures.\n\nImportant diagnostic:\n- Passing OpenClaw runtime [email protected] Agent to Node 24 global fetch reproduces InvalidArgumentError: invalid onRequestStart method, code UND_ERR_INVALID_ARG.\n- However, the installed fetchWithSsrFGuard appears to route dispatcher calls through bundled runtime undici.fetch, and direct guarded Voyage controls succeed.\n- So the embedding CLI failure may be from a provider path that bypasses that runtime-fetch fallback, passes a custom fetchImpl, or otherwise loses the underlying cause.\n\nExpected:\n- Embedding CLI should succeed when the same key/request succeeds through direct fetch and guarded fetch.\n- If fetch fails, CLI should surface error.cause / UND_ERR_* details instead of only TypeError: fetch failed.\n\nAsk:\n- Please audit the infer embedding create / Voyage provider path for any global-fetch + runtime-dispatcher mixing or custom fetchImpl path.\n- Please preserve/log the underlying fetch cause for provider embedding failures.

extent analysis

TL;DR

The issue can be resolved by auditing the infer embedding create path for mixing global-fetch and runtime-dispatcher, and preserving the underlying fetch cause for provider embedding failures.

Guidance

  • Review the infer embedding create code path to identify any potential mixing of global-fetch and runtime-dispatcher, which may cause the TypeError: fetch failed error.
  • Check if a custom fetchImpl is being used in the Voyage provider path, which could bypass the runtime-fetch fallback and lead to the error.
  • Modify the code to preserve and log the underlying fetch cause for provider embedding failures, instead of only returning a generic TypeError: fetch failed message.
  • Verify that the undici Agent is being used correctly with Node 24 global fetch, and that the fetchWithSsrFGuard is routing dispatcher calls through the bundled runtime undici.fetch as expected.

Example

No code snippet is provided as the issue does not contain sufficient information to create a specific example.

Notes

The issue seems to be related to the interaction between the undici library and the Node 24 global fetch. The UND_ERR_INVALID_ARG error suggests that there may be an issue with the onRequestStart method. However, without more information about the code, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Audit the infer embedding create path and preserve the underlying fetch cause for provider embedding failures, as this is likely to provide more insight into the issue and allow for a more targeted fix.

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