fix(gateway): classify wrapped "fetch failed" messages as transient network errors#38530
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11fa4e98c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Greptile SummaryThis PR fixes a gateway crash caused by Key changes:
The solution is straightforward: substring matching with "fetch failed" is a strict superset of the old exact-match logic. All 39 existing tests pass, and a new test for the reported scenario is included. Confidence Score: 5/5
Last reviewed commit: 11fa4e9 |
…etwork errors
When Discord wraps a fetch failure into a higher-level error like
"Failed to get gateway information from Discord: fetch failed",
the previous exact-match check (message === "fetch failed") missed it,
causing the gateway to crash instead of continuing.
Move "fetch failed" into TRANSIENT_NETWORK_MESSAGE_SNIPPETS so substring
matching catches both bare and wrapped forms. Remove the now-redundant
exact-match checks for TypeError("fetch failed") and message === "fetch failed".
Closes openclaw#38510
11fa4e9 to
91ffeae
Compare
|
PR #38530 - fix(gateway): classify wrapped "fetch failed" messages as transient network errors (#38530) Merged after verification.
|
…etwork errors (#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 1a022a3)
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com> (cherry picked from commit 1a022a3)
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
…etwork errors (openclaw#38530) Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: xinhuagu <562450+xinhuagu@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Problem
When Discord's
ProxyGatewayPluginwraps a fetch failure into a higher-level error like:the previous exact-match check (
message === "fetch failed") missed it. The error was not classified as transient, so the unhandled rejection handler calledprocess.exit(1), crashing the entire gateway instead of just the Discord provider.Closes #38510
Fix
"fetch failed"toTRANSIENT_NETWORK_MESSAGE_SNIPPETSso the existing substring matching catches both bare and wrapped formsTypeErrorinstance check andmessage === "fetch failed")This is a strict superset of the previous behavior — all previously matched errors still match, plus wrapped variants like the Discord gateway error.
Testing