mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #150] [MERGED] feat: add model_provider / strict_mode / fallback_provider to model run #153
Labels
No labels
audit:ai-readiness
audit:community
audit:github
audit:health-scoring
audit:policy
audit:release
audit:supply-chain
bug
cursor-review-pin
effort:medium
effort:small
effort:trivial
priority:nice-to-have
priority:recommended
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-typescript-sdk#153
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-typescript-sdk/pull/150
Author: @deepme987
Created: 9/17/2026
Status: ✅ Merged
Merged: 9/18/2026
Merged by: @mattmillerai
Base:
main← Head:deepme987/router-provider-params📝 Commits (7)
754eac7chore: sync vendored Comfy Router spec from cloud@996a63cb5e1a65feat(models): add model_provider / strict_mode / fallback_provider to model run002de57test(models): add live Router alt-provider model-run e2e3387914fix(models): surface the alt-provider disclosure and stop two silent inversions9e3e162test(integration): require an explicit opt-in before the e2e tests bill1837661fix(retry): treat queue_timeout as terminal, and document the key's query identity24a7fcbtest(index): name the three new Router error classes at the package root📊 Changes
16 files changed (+1230 additions, -116 deletions)
View changed files
📝
CHANGELOG.md(+19 -0)📝
spec/router-openapi.yaml(+398 -35)📝
src/index.test.ts(+8 -1)📝
src/sdk/index.ts(+1 -1)📝
src/sdk/modelRequests.ts(+16 -1)➕
src/sdk/modelRoutes.test.ts(+74 -0)📝
src/sdk/modelRoutes.ts(+80 -0)📝
src/sdk/models.test.ts(+70 -1)📝
src/sdk/models.ts(+147 -7)📝
src/sdk/retry.test.ts(+8 -0)📝
src/sdk/retry.ts(+8 -0)📝
src/sdk/router-spec-contract.test.ts(+79 -43)📝
src/sdk/routerErrors.test.ts(+20 -9)📝
src/sdk/routerErrors.ts(+92 -18)📝
src/sdk/surface-parity.test.ts(+16 -0)➕
test/integration/router-models-e2e.test.ts(+194 -0)📄 Description
What
Adds Comfy Router's three alt-provider controls to
comfy.models.run, as optionalRunOptionsfields sent as query params on the synchronous run route (POST /v2/models/{provider}/{model}):modelProvider(wiremodel_provider) — selects an alternate serving provider, e.g."fal".strictMode(wirestrict_mode, renderedtrue/false) —false(default) translates between the model's native shape and the alternate provider both ways;truepasses the provider's own raw shape unchanged in both directions.fallbackProvider(wirefallback_provider) —"false"opts out of Router retrying against the model's other registered provider.Each is built by
routerRunQuery(inmodelRoutes.ts) and emitted ONLY when the caller set it, in a fixed order. A run that names none appends no query at all, so it is byte-for-byte the request this route has always made.Also reconciles the SDK with the vendored Router spec sync (
cloud@996a63c) this branch is stacked on:cancelled,queue_timeout,request_not_found— asrouterErrors.Cancelled/QueueTimeout/RequestNotFound(registered inBY_ERROR_TYPE, added toTRANSPORT_ERROR_TYPES). This is what the closed-set coverage gate (router-spec-coverage.test.ts) requires. They lead the Python SDK's table until its twin lands, declared in thesurface-parityallowlist.requestscollection (replacing the relation-only pin + its rot guard), and accounts for the four new operations in the route-coverage map.Scope
Run route ONLY. The
model_provider/strict_mode/fallback_providerparams are not added tosubmit/subscribe/ the queuedRequestHandle— the backend does not accept them on the queue routes.Testing
pnpm typecheck,pnpm lint,pnpm format:check,pnpm test(637 passed),pnpm build, andpnpm check:spec-driftall green locally.src/sdk/modelRoutes.test.tscoversrouterRunQuery: empty when unset, per-field emission,strict_modetrue/false, fixed order, and value encoding.models.test.tsprove the query reaches the request path only when set, and is absent otherwise.routerErrors.test.ts/router-spec-coverage.test.tscover the three new buckets end to end.No live API calls.
Companion PRs
Summary by CodeRabbit
New Features
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
uses:this scanner cannot read #174