Skip to content

fix: raise Ollama transport timeouts (undici 300s default killed long 35B generations)#17

Merged
ryandmonk merged 3 commits into
mainfrom
fix/ollama-timeout
Jul 3, 2026
Merged

fix: raise Ollama transport timeouts (undici 300s default killed long 35B generations)#17
ryandmonk merged 3 commits into
mainfrom
fix/ollama-timeout

Conversation

@ryandmonk

Copy link
Copy Markdown
Contributor

Closes the last infrastructure hole the rerun exposed: repeatable fetch failed on the same cells, dying at ~301s with zero attempts recorded — undici's default headersTimeout (300s) aborting long local generations. The retry pass reproduced it on the same cells (p09/p11 long-thinking runs), ruling out flakiness; successful long runs all finished under ~300s per request.

Fix: OllamaAdapter sends requests through a long-lived undici Agent with headers/body timeouts raised to one hour — a deliberate ceiling for local inference, not "no timeout" (a hung server still fails rather than blocking a matrix forever). undici added as a dependency (adapter path only; the zero-network core boundary is untouched — its test still passes). Injected test fetches ignore the option; a new test asserts it's passed.

On merge: I delete the 3 remaining transport reports and run the final retry, which should leave qwen's column with zero infrastructure pollution.

AC: 76 tests green.

🤖 Generated with Claude Code

…ong 35B generations

Diagnosis from the 2026-07-03 rerun: repeatable "transport failure: fetch
failed" on the same cells, dying at ~301s with zero attempts recorded —
undici's default headersTimeout (300s) aborting single long local
generations. The retry pass reproduced it on the same cells, ruling out
flakiness.

OllamaAdapter now sends requests through a long-lived undici Agent with
headers/body timeouts raised to one hour — a deliberate ceiling for local
inference, not "no timeout": a truly hung server still fails rather than
blocking a matrix forever. Injected test fetches ignore the dispatcher
option; a test asserts it is passed. Anthropic adapter unaffected (the SDK
manages its own timeouts).

AC: 76 tests (75 + dispatcher-option test).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 3, 2026 14:36
…gines floor (>=20)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses repeatable ~301s fetch failed transport failures during long local Ollama generations by routing OllamaAdapter requests through an undici Agent configured with much longer headers/body timeouts (1 hour), and adds eval rerun matrices documenting the rerun setup.

Changes:

  • Add a long-lived undici Agent dispatcher in OllamaAdapter with 1-hour headersTimeout/bodyTimeout.
  • Add a unit test asserting the Ollama request carries the dispatcher option.
  • Add undici as a dependency and add rerun matrix JSON configs for eval runs.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/adapters/ollama.ts Adds an undici Agent dispatcher with raised transport timeouts and passes it via fetch init.
src/adapters/adapters.test.ts Adds a test to ensure Ollama requests include the dispatcher option.
package.json Adds undici dependency needed for the dispatcher/timeout configuration.
package-lock.json Locks undici dependency resolution and records its engine requirements.
eval/matrix.rerun.json Adds a documented rerun eval matrix (local + hosted) for the 2026-07-03 rerun.
eval/matrix.rerun-local.json Adds a local-only rerun matrix configuration.
eval/matrix.rerun-hosted.json Adds a hosted-only rerun matrix configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/adapters/ollama.ts Outdated
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ryandmonk ryandmonk merged commit 72e1019 into main Jul 3, 2026
2 checks passed
@ryandmonk ryandmonk deleted the fix/ollama-timeout branch July 5, 2026 02:34
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.

2 participants