Skip to content

Do not resend a REST call that used up its whole deadline - #1502

Merged
helpcodeai merged 2 commits into
mainfrom
fix/no-retry-after-full-timeout
Nov 4, 2026
Merged

helpcodeai merged 2 commits into
mainfrom
fix/no-retry-after-full-timeout

Conversation

@helpcodeai

Copy link
Copy Markdown
Contributor

Summary

A REST call that ran into its whole deadline without an answer was sent again up to three times when it was idempotent (GET, PUT). With the default 30 s timeout that is about 124 s before the model gets an error, longer than most MCP clients wait. Cloud logs of 3-4 Nov: 13 calls in 3 workspaces ended with "Could not reach the API after 4 attempts ... (ECONNABORTED)" after ~124 s (PrestaShop 11, Telegram 1, a hand-built connector 1).

Tools that raised their own timeoutMs already got no retry after a timeout. This applies the same rule to every call that used up its deadline.

Changes

  • requestWithRetry: no retry when the error is the request deadline (ECONNABORTED with "timeout of ms exceeded", raised by axios and by outbound-http).
  • Other ECONNABORTED errors (a socket aborted early), ETIMEDOUT, ECONNRESET, 502/503/504 and 429 are retried as before.
  • The error the model sees is unchanged: "Could not reach the API: the request was aborted before the API responded (ECONNABORTED)".

Cloud and self-hosted behave the same.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

New case: a GET and a PUT that hit "timeout of 30000ms exceeded" are sent once. The existing case "still retries a GET/PUT that timed out" (other ECONNABORTED) still passes.

In packages/backend:

  • npx jest src/connectors/engines/rest.engine --maxWorkers=4 → 204 passed
  • npx eslint on the changed files → exit 0
  • npx tsc --noEmit -p tsconfig.json → exit 0

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • All existing tests pass (npm test)
  • This PR has a descriptive title

Related Issues

Found in the 2026-11-04 Cloud log review.

@helpcodeai
helpcodeai enabled auto-merge (squash) November 4, 2026 08:12
@helpcodeai
helpcodeai merged commit f69a92c into main Nov 4, 2026
14 checks passed
@helpcodeai
helpcodeai deleted the fix/no-retry-after-full-timeout branch November 4, 2026 10:06
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant