Repository navigation
Plan 323 — a long prompt on a local model no longer reads as an unreachable runtime - #125
Merged
Merged
Conversation
…hable runtime Node's fetch abandons a response whose headers take five minutes. Ollama sends none until it has read the whole prompt, and Helmsman's prompt on Gemma took longer than that on a 24 GB machine: each attempt failed at 300 s as "Ollama is not reachable", three times, well inside the 15-minute idle window the platform gives a local model. - Every request to the local runtime goes through localRuntimeFetch, an undici Agent with no header or body limit, so the caller's signal is the only limit. The pull stream needed the same: the runtime is silent while it checks a large layer's digest. - "Not reachable" only for causes that mean nothing answers at the URL; any other broken request names its cause. - Silence through the whole idle window fails without a retry, naming the remedy (a smaller window or model), since a retry re-reads the prompt. - The spill estimate says the model will spill as its conversations fill the window, not that it is spilling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
In the live test of #123, Helmsman's first turn on Gemma 4 26B failed three times, each attempt at almost exactly 300 s (11:16:29, 11:21:42, 11:26:58). Each time it was reported as
Ollama is not reachable at http://127.0.0.1:11434: fetch failed, and Ollama was running throughout.Why: Node's fetch (undici) abandons a response whose headers take 5 minutes (
headersTimeout), and a body that stays silent for 5 (bodyTimeout). Ollama sends no headers until it has read the whole prompt, and Helmsman's prompt on this 24 GB machine took longer than that. The platform's own 15-minute idle window for local models (AI_LOCAL_MODEL_IDLE_TIMEOUT_MS, §9 G5) never got the chance to apply.The cause is reproduced with a probe: an undici
Agentwith a 1 sheadersTimeoutfails asfetch failed, causeUND_ERR_HEADERS_TIMEOUT, and with0it waits. That holds on this machine's Node 22.16, which bundles undici 6.21, with undici 7 passed in as thedispatcher.The fix
localRuntimeFetchsends every Ollama request (chat, embed, warm, status reads, pull, delete) through an undiciAgentwith neither limit. The caller's signal is the only limit: the idle window for a turn, the lease for a download. The pull stream needed this as well, because Ollama is silent while it checks a large layer's digest.undici@^7is now a declared dependency of@aflow/ai-client. 8.x requires Node ≥ 22.19, and this machine runs 22.16.ECONNREFUSED,ENOTFOUND,EHOSTUNREACH, …). Any other broken request names its cause.Not in this PR
Testing
ollama.test.ts: four tests replace the old network-failure one:yarn typecheckpasses.yarn test:changed: 16250 pass, 1 fails. The failure is the hostcheckoutReplacementtest, which also failed on Plan 323 P3 + P3b — models on this computer, diagnosed, managed, and changed by Helmsman with approval #123 and imports nothing touched here.live, a Helmsman turn in Walkthrough should run past 5 minutes and answer.🤖 Generated with Claude Code