Repository navigation
Plan 323 — Ollama requests use undici's own fetch; yarn start installs a changed lockfile - #129
Merged
Merged
Conversation
…alls a changed lockfile On the dev stack every request to Ollama failed with `invalid onRequestStart method`: the checkout had not installed since undici@7 was added, so @aflow/ai-client resolved jsdom's hoisted undici@8, and Node 22.16's own fetch (its bundled undici 6) refuses an Agent from another major. The diagnosis read the failure as a runtime not answering, the banner offered Start Ollama for a runtime already running, and every agent turn failed. - localRuntimeFetch calls undici's fetch with undici's Agent, one package, so the pair agrees whatever Node bundles or the install hoists. Proven on the stale checkout: undici@8's own pair reaches Ollama on Node 22.16. A real-server test covers a request, a streamed body and the caller's signal, which the adapter tests (answering through the global fetch) cannot. - yarn start runs yarn install when yarn.lock changed after the last install, before anything resolves a package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
After #127 and #128 were merged into
live, every request to Ollama from the server and the executors failed with:invalid onRequestStart method (UND_ERR_INVALID_ARG)livehad not runyarn installsince Oct 16, soundici@7(added in Plan 323 — a long prompt on a local model no longer reads as an unreachable runtime #125) was never installed.@aflow/ai-clientresolved jsdom's hoistedundici@8, and Node 22.16's built-in fetch, which bundles undici 6, refuses anAgentfrom another major version.The fix
localRuntimeFetchuses undici's ownfetchwith undici'sAgent. Both come from one package, so the pair agrees whatever Node bundles or the install hoists.livecheckout:undici@8's own pair reaches Ollama on Node 22.16.localRuntimeFetch.test.ts) covers a request, a streamed body and the caller's signal. The adapter tests answer through a stubbed global fetch, so they can't cover the transport; they now mock the module.yarn startinstalls whenyarn.lockhas changed since the last install (scripts/installState.mjs, fromnode_modules/.yarn-state.yml), before anything resolves a package. Onlivetoday it reports stale; on a fresh worktree, current.Testing
@aflow/ai-client: 360 tests pass, including 3 new transport tests.installState: 3 tests pass.yarn typecheckpasses.🤖 Generated with Claude Code