Skip to content

fix(activation): add per-call timeout to embedding fetch#81

Merged
MAnders333 merged 1 commit into
mainfrom
fix/embedding-fetch-timeout
Jun 5, 2026
Merged

fix(activation): add per-call timeout to embedding fetch#81
MAnders333 merged 1 commit into
mainfrom
fix/embedding-fetch-timeout

Conversation

@MAnders333
Copy link
Copy Markdown
Owner

The EmbeddingClient.embedBatch fetch had no AbortSignal, so a slow or rate-limited embedding proxy (e.g. the unified LLM proxy) caused the request to hang indefinitely. The held TCP connection silently broke the /activate HTTP route and the MCP 'activate' tool — the MCP 15s timeout surfaced the hang as a generic TimeoutError with no indication of the actual cause.

Add a configurable per-call timeout (default 20s, override via EMBEDDING_TIMEOUT_MS) wired into the fetch via AbortSignal.timeout. Also expose timeoutMs as an EmbeddingClient constructor option for testability. Regression test uses a hanging local Bun.serve to verify the fetch aborts within the configured window.

The EmbeddingClient.embedBatch fetch had no AbortSignal, so a slow or
rate-limited embedding proxy (e.g. the unified LLM proxy) caused the
request to hang indefinitely. The held TCP connection silently broke
the /activate HTTP route and the MCP 'activate' tool — the MCP 15s
timeout surfaced the hang as a generic TimeoutError with no
indication of the actual cause.

Add a configurable per-call timeout (default 20s, override via
EMBEDDING_TIMEOUT_MS) wired into the fetch via AbortSignal.timeout.
Also expose timeoutMs as an EmbeddingClient constructor option for
testability. Regression test uses a hanging local Bun.serve to verify
the fetch aborts within the configured window.
@MAnders333 MAnders333 merged commit 79d3cf8 into main Jun 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant