Repository navigation
fix(ollama): keep active remote model streams from timing out - #115648
Merged
Merged
Conversation
Retain the existing guarded-fetch timeout callback while consuming native Ollama NDJSON. Prove active slow HTTP streams remain alive and genuine stalls still expire. Reconstructed from the independently reviewed contributor fix for #94251. Co-authored-by: Henry <[email protected]>
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 29, 2026
…115648) Retain the existing guarded-fetch timeout callback while consuming native Ollama NDJSON. Prove active slow HTTP streams remain alive and genuine stalls still expire. Reconstructed from the independently reviewed contributor fix for openclaw#94251. Co-authored-by: Henry <[email protected]>
vincentkoc
added a commit
that referenced
this pull request
Jul 29, 2026
…ifecycle-hooks * origin/main: fix(mattermost): key private channels as group on outbound routing (#96645) fix(ci): grant Telegram QA runtime scratch access (#115659) fix(telegram): stop retrying blocked recipients (#115640) fix(tts): persist generated speech in media store (#115647) fix(gateway): preserve complete streamed chat completions (#115652) fix(mac): prevent app auth from blocking node-host startup (#115533) fix(heartbeat): keep message-tool final replies private (#115629) fix(gateway): drain root work continuations before direct-stop process exit (#105848) fix(ollama): keep active streams within their idle timeout (#115648) fix(delivery): keep session keys out of inferred message targets (#115657) fix(ci): type code mode matrix catch callback (#115674) refactor(agents): centralize bundled CLI backend auth policy (#115633) refactor: remove 3,527 lines of runtime and test duplication (#115626) [AI] fix(doctor): stop repeated bundledDiscovery migration noise on beta (#115208) # Conflicts: # scripts/code-mode-model-matrix.ts
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.
Fixes #94251.
What Problem This Solves
Fixes an issue where users streaming a slow remote Ollama model would lose an actively progressing response once the initial request timeout expired, even though valid tokens continued arriving.
Why This Change Was Made
Honor the existing guarded fetch's idle-timeout contract whenever an actual Ollama NDJSON response makes progress. Preserve the existing SSRF guard, caller cancellation, dispatcher release, and timeout for a genuinely stalled stream.
This independently reviewed canonical fix builds on @henrybrewer00-dotcom's original diagnosis and patch in #96635. The official-repository commit explicitly retains Henry's original
Co-authored-bycredit.User Impact
Users can stream a slow remote Ollama model for longer than the configured idle timeout while valid responses continue arriving. A stream that actually stops responding still times out.
Evidence
The regression uses a real local
node:httpTCP server and the actual native Ollamaapplication/x-ndjsontransport, not a simulated response: it sends token chunks every 35 ms with a 120 ms guarded idle timeout.Before the fix:
refreshTimeoutcallback was called zero times instead of three.After the fix:
Validation against the exact pushed commit:
node scripts/run-vitest.mjs extensions/ollama/src/stream.test.ts extensions/ollama/src/stream-runtime.test.ts: 2 files, 142 tests passed../node_modules/.bin/oxfmt --check extensions/ollama/src/stream.ts extensions/ollama/src/stream.test.ts: passed.git diff --check: passed../.agents/skills/autoreview/scripts/autoreview --mode commit --commit HEAD --thinking xhigh: clean; no accepted or actionable findings.