fix(ollama): yield during dense stream processing#86633
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 27, 2026, 8:09 AM ET / 12:09 UTC. Summary PR surface: Source +41, Tests +41. Total +82 across 2 files. Reproducibility: no. not for the live end-to-end issue on this PR branch. Source inspection and maintainer probes support the dense Ollama stream path, but no live OpenClaw/Ollama or Windows gateway reproduction after the patch is supplied. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance: Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land this as a narrow native-Ollama mitigation only after redacted real local-provider proof, while keeping the broader local-provider starvation work tracked separately. Do we have a high-confidence way to reproduce the issue? No, not for the live end-to-end issue on this PR branch. Source inspection and maintainer probes support the dense Ollama stream path, but no live OpenClaw/Ollama or Windows gateway reproduction after the patch is supplied. Is this the best way to solve the issue? Unclear but plausible. Cooperative yielding is a narrow maintainable mitigation for dense native Ollama chunks, but the discussion shows the broader root cause also includes repeated full-partial stream work across sibling paths. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 7efbaf7dba13. Label changesLabel justifications:
Evidence reviewedPR surface: Source +41, Tests +41. Total +82 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Related: #86599. This PR addresses one contributor from that issue: native Ollama can deliver dense stream chunks, and the Ollama parser can process many of them before the gateway gets a chance to handle other work. I would scope this as a related but partial mitigation. It may improve the native-Ollama dense-stream path, but #86599 is broader unless we also prove the gateway stays responsive during the original repro and address the repeated full-partial stream work discussed there. |
Summary
Real behavior proof
Behavior or issue addressed: Ollama stream chunk processing was monopolizing the event loop on dense native streams.
Real environment tested: local OpenClaw checkout in /Users/miya/Desktop/openclaw-issue-86599.
Exact steps or command run after this patch:
pnpm test extensions/ollama/src/stream.test.tsEvidence after fix:
Observed result after fix: the dense-stream regression test passed after the cooperative-yield change.
What was not tested: I did not reproduce the Windows beta gateway loop on a live Windows beta machine in this environment.
Verification
pnpm test extensions/ollama/src/stream.test.ts