@devries-cameron20 / composio-1 / commits / b71471c6e
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(telemetry): bound telemetry requests with an AbortSignal timeout (#4127)

## What `TelemetryService.sendMetric` and `sendErrorLog` issue `await fetch(...)` with no timeout. If the telemetry endpoint stalls, the await never settles. Both are awaited on the SDK's telemetry path (`Telemetry.ts` batch-processor callback, `sendMetric`, and `sendErrorTelemetry`), so a stalled telemetry endpoint can leave an SDK call pending indefinitely — which the existing `catch` comment says must never happen ("telemetry failures should never affect SDK calls"). ## Fix Wrap both requests in a private `postWithTimeout` helper that bounds each best-effort request with an `AbortController` + `setTimeout` (3s) and clears the timer in `.finally()`. This mirrors the already-merged bound on the background npm version check in `utils/version.ts` (#4027), including the hand-rolled-timer-over-`AbortSignal.timeout` rationale: an uncleared timer pins the workerd request context open for the full timeout on every successful send. On timeout the abort rejects `fetch`, which the existing `catch` swallows exactly as it already swallowed network errors, so the best-effort / never-throws contract is unchanged. ## Tests Adds a `TelemetryService network bounding` suite (mirrors `version.test.ts`): asserts each method passes an `AbortSignal` and clears its timer on success, and that a never-responding endpoint resolves to `undefined` without throwing. Verified fails-before / passes-after; full `@composio/core` suite green (1092 tests), plus `tsc`, oxlint, and prettier all clean.

Alberto Schiabel committed Aug 27, 2026 at 18:29 UTC b71471c6ef850fce405e9571b4707a5b5aae5b87

No changes.