Repository navigation
fix(model): return actionable errors when undici is missing - #501
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change to return actionable missing-undici errors through the model’s Result contract.
No open issues 🎉
What changed in this PR
Addresses #492 by returning actionable missing-undici errors through the model’s Result contract instead of rejecting complete().
Changes:
- Matches Node’s missing-package error specifically for
undici. - Catches proxy dispatcher initialization failures in both Chat Completions and Responses API models.
- Adds an isolated regression test covering both API paths without
undiciinstalled.
| File | Description |
|---|---|
typescript/tests/model.test.mjs |
Tests actionable failure results for both API paths using an isolated copy of the compiled model. |
typescript/src/model.ts |
Corrects missing-undici detection and returns dispatcher failures as error results. |
Review effort: Balanced
robgruen
approved these changes
Nov 1, 2026
robgruen
left a comment
Contributor
There was a problem hiding this comment.
Great find, thank you for your contribution!
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 #492.
When a proxy is set without the optional
undicipackage, Node reportsERR_MODULE_NOT_FOUNDwithCannot find package, not the message the existing guard expects. Match the missingundicipackage specifically and return the actionable message as aResultfrom both Chat Completions and Responses API models instead of rejectingcomplete().Regression: copy the built model into a temporary directory without
undiciand check both API paths. The new test fails with the raw module error on the original code. Focusedmodel.test.mjs: 33/33 passed in an offline Podman container with Bun-transpiled sources and Node 24. Fullnpm testwas not run because locked dependencies were unavailable offline and package downloads were blocked.