fix(lib): derive NextTurnParamsContext.models from the generated request type - #821
Open
LukasParke wants to merge 1 commit into
Open
fix(lib): derive NextTurnParamsContext.models from the generated request type#821LukasParke wants to merge 1 commit into
LukasParke wants to merge 1 commit into
Conversation
…est type openrouter-web#34136 widens the models fallback array to (string | ReasonGatedFallbackModel)[] for reason-gated fallback entries. The hand-written NextTurnParamsContext hard-coded string[], which breaks SDK compilation the moment the spec regenerates. Deriving the field from ResponsesRequest['models'] keeps it in lockstep with the generated type: string[] today, the union after regen, no further edits needed.
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
Replaces the hand-written
models: string[]onNextTurnParamsContextwithNonNullable<models.ResponsesRequest['models']>, deriving it from the generated request type.Why
openrouter-web#34136 introduces reason-gated fallback entries: the
modelsarray becomes(string | ReasonGatedFallbackModel)[]. The upstreamsdk-build-check (typescript)CI job fails on that PR because this hand-written type no longer matches:Deriving the field keeps it in lockstep with the generated
ResponsesRequest—string[]today, the union after the spec regenerates, with no further edits needed.pnpm typecheckpasses on currentmainwith this change (it is safe to merge before the upstream PR).Testing
pnpm typecheckgreen on current generated typesbuildNextTurnParamsContext) assignsrequest.models ?? [], which is exactly this type