mirror of
https://github.com/Comfy-Org/comfy-typescript-sdk.git
synced 2026-11-04 23:47:27 +00:00
[PR #168] [MERGED] docs(models): re-align the dropped-params comments with the synced Router spec #169
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#169
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/168
Author: @mattmillerai
Created: 9/21/2026
Status: ✅ Merged
Merged: 10/9/2026
Merged by: @mattmillerai
Base:
main← Head:matt/be-16281-router-dropped-params-docs📝 Commits (5)
90c6669docs(models): re-align the dropped-params comments with the synced Router specd559e05docs(models): scope the droppedParams null guarantee to what the spec promisesdd5e3d2Merge remote-tracking branch 'origin/main' into matt/be-16281-router-dropped-params-docsd3a2dc8Merge remote-tracking branch 'origin/main' into matt/be-16281-router-dropped-params-docs025849bdocs(models): ground the queued route's no-disclosure note in its declared contract📊 Changes
4 files changed (+59 additions, -27 deletions)
View changed files
📝
CHANGELOG.md(+10 -0)📝
src/sdk/modelRequests.ts(+5 -4)📝
src/sdk/models.test.ts(+4 -5)📝
src/sdk/models.ts(+40 -18)📄 Description
ELI-5
A response header tells you which of your settings the Router had to drop when it translated your request for a different provider. Three comments in the code still described an older version of the contract: they said the spec's own declaration of that header was a bug that someone had filed against the server, and they said the header only ever shows up when you explicitly ask for another provider. The spec sync in #166 settled both points the other way — the header really is one JSON-encoded string on purpose, and an automatic retry can produce it too, even on a call that asked for nothing special. This rewrites those three comments to say what is now true. No code changes.
What changed
Comments only.
git difftouchessrc/sdk/models.ts,src/sdk/models.test.tsandCHANGELOG.md; every changed line in the two source files is inside a comment (verified mechanically — filtering the diff's+/-lines for anything that is not//,*,/**or*/returns nothing).parseDroppedParamsTSDoc. Deleted the claim that the spec's prose and its declared schema disagree, that the declared schema is the wrong half, and that a spec defect is filed against the server'sopenapi.ymland would be reverted by the next sync.spec/router-openapi.yaml'sRouterDroppedParamsHeadernow declarestype: stringand its description says, in its own words, to "decode it with a JSON parser rather than splitting it on commas, because it is a single string on the wire… and each entry is a sentence carrying commas of its own". The comment now says that, keeps the example entry (moderation (fal applies its own, non-configurable safety filtering)) as the reason, and keeps the existing fallback rationale verbatim in spirit: keep a non-JSON value as ONE entry rather than guessing at delimiters, because a single entry a human can read beats two confident fragments.RunJsonResult.droppedParamsTSDoc. It namedmodelProvideras the only producer. The synced spec names two, both under the defaultstrict_mode=false: an explicitmodel_providertranslation and an automaticfallback_providerretry — which is on by default and independent ofmodel_provider— so a call that never setmodelProvidercan still come back with a non-null value. The comment now says so, adds that a fallback retry's list describes THAT retry's translation rather than the primary attempt's, points atservingProviderfor which provider it refers to, and spells out thenullcases.RunJsonResult.droppedParamsTSDoc, review round 2 (d559e05). Three cursor-review findings on that same block, all settled by the vendored spec. (a)strictMode: truewas listed unqualified as anullcase;StrictModeatspec/router-openapi.yaml:888-895says it is "only meaningful together withmodel_provider", andRouterDroppedParamsHeadernames the automaticfallback_providerretry as an independent producer, sostrictMode: truesuppresses themodelProvidertranslation only and is not on its own a guarantee ofnull— the comment now says that and points atfallbackProviderfor the case that is. (b) "each entry names the field and why" was unconditional, butparseDroppedParamskeeps a header that is not a JSON array of strings as ONE entry holding the raw wire value, so that is now the normal case rather than a guarantee. (c)nullfor "translation ran and dropped nothing" holds only because the server omits the header there — a present-but-empty"[]"parses to an empty array, asmodels.test.ts:1746and:1753already assert — so callers are told to check!== nullrather than truthiness. Still comments only.parseDroppedParamstest comment. Rewritten to the same framing. Theit(...)title and everyexpectare unchanged.### Fixedbullet under[Unreleased]. The repo does log doc-comment changes (0.1.5"TSDoc for the public API members that had none",0.1.4"…and doc comments updated to the new host") andsrc/ships in the published package, so these comments are user-visible on hover.RunBinaryResult.droppedParamsalready reads "As {@link RunJsonResult.droppedParams}" and is untouched, as is theDROPPED_PARAMS_HEADERconstant's one-line comment,parseDroppedParams's body, every test assertion, andspec/.Verification against what the spec actually says
The primary artifact here is the vendored spec as of #166 (commit
4491e4b;mainhas since moved past it without touchingspec/router-openapi.yaml), and I read it directly rather than from the ticket's summary:spec/router-openapi.yaml:927-932declaresRouterDroppedParamsHeaderwithschema: {type: string},example: '["moderation (fal applies its own, non-configurable safety filtering)"]', and a description that covers both producers ("whether the caller asked for that translation withmodel_provider(strict_mode=false, the default) or an automaticfallback_providerretry ran it") and the fallback-retry attribution ("On a fallback retry it names what that retry's own translation… dropped, never the primary attempt's"). Every substantive claim in the new comments is traceable to that block or toRouterFallbackProviderHeaderat:938-943.Negative-claim falsification (the capability-denial trigger) does not fire on this diff: it adds no "not supported"/"unavailable" string, no throw or deny path, and flips no test to assert a dead-end. The change is strictly the opposite direction — it documents a case (
droppedParamsnon-null with nomodelProvider) the old comment wrongly ruled out.Provenance
d3a2dc8(merge ofmainat8096086, no conflicts; the earlierCHANGELOG.md### Fixedconflict was resolved by keeping both bullets).pnpm test: 691 passed, 5 skipped, 0 failed (28 files passed, 1 skipped).pnpm lint,pnpm format:check,pnpm typecheckandpnpm build: clean.pnpm check:spec-drift: generated code is in sync, and the Router route matches the spec.node scripts/sync-python-surface.mjsreportsparity/python-surface.json is stale relative to Comfy-Org/comfy-python-sdk@refs/heads/main.mainfails the same way (CI run 37967760042 at8096086), so the problem is in the base, not this branch. The open fix is #201, and the check is not required.d559e05was added on top in response to review feedback. It gets no CHANGELOG bullet of its own, because the existing[Unreleased]bullet already covers the comment it refines.Residual
Not fixed here, and worth its own look:
src/sdk/modelRequests.ts:893-899carries a related claim that this sync may have weakened. The comment above the queued-collect result says the two alt-provider disclosure headers "are expected to be absent on this route — the queued/requestspath takes nomodel_providerparameter, so a queued run cannot address an alternate provider and has nothing to disclose". Post-#166 the second producer of those headers is an automaticfallback_providerretry that is independent ofmodel_provider, so "takes nomodel_provider" no longer establishes "has nothing to disclose" on its own. I did not change it: the fourMODEL_REQUEST*operations are not declared inspec/router-openapi.yamlat all (held upstream, and the one-way sync strips a held operation — seeAGENTS.mdsection 2), so there is nothing in the vendored contract that says whether fallback applies to the queued route, and guessing in a comment is how this ticket's defect got written in the first place. The code is unaffected either way — it reads the headers unconditionally and returns whatever is there. Resolving it needs a statement from the Router side about queued-route fallback.router_run.go'swriteRouterResultin thecloudrepo as the side thatjson.Marshals the list. That repo is not in this sandbox and is outside this PR's repo, so I could not read it. I substituted the vendored spec, which is the contract this SDK is actually checked against, and the parser's behavior is unchanged regardless — nothing in this diff depends on the Go source being what the ticket says it is.X-Comfy-Credits-Used) has landed and is merged in here;src/sdk/models.tsauto-merged. #164 (replayed) and #152 (Idempotency-Keyon errors) are still open, and each adds an adjacentRunJsonResultfield rather than touching these comment blocks.sdk-paritycheck is pre-existing and does not come from this branch. Earlier it failed with anExtractionErroronRouterRunResult. That was fixed by #167, which is merged in here. It now fails because the Python surface snapshot is stale, andmainfails identically (run 37967760042 at8096086). This is the caseAGENTS.mdsection 6 describes as "usually not about your branch", and #201 is the open snapshot refresh.Summary by CodeRabbit
nullor an empty array depending on whether any parameters were dropped.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
uses:this scanner cannot read #174