Skip to content

fix(lib): derive NextTurnParamsContext.models from the generated request type - #821

Open
LukasParke wants to merge 1 commit into
mainfrom
agent/reason-gated-models-compat
Open

fix(lib): derive NextTurnParamsContext.models from the generated request type#821
LukasParke wants to merge 1 commit into
mainfrom
agent/reason-gated-models-compat

Conversation

@LukasParke

@LukasParke LukasParke commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

What

Replaces the hand-written models: string[] on NextTurnParamsContext with NonNullable<models.ResponsesRequest['models']>, deriving it from the generated request type.

Why

openrouter-web#34136 introduces reason-gated fallback entries: the models array becomes (string | ReasonGatedFallbackModel)[]. The upstream sdk-build-check (typescript) CI job fails on that PR because this hand-written type no longer matches:

src/lib/next-turn-params.ts(24,5): error TS2322: Type '(string | ReasonGatedFallbackModel)[]' is not assignable to type 'string[]'.

Deriving the field keeps it in lockstep with the generated ResponsesRequeststring[] today, the union after the spec regenerates, with no further edits needed. pnpm typecheck passes on current main with this change (it is safe to merge before the upstream PR).

Testing

  • pnpm typecheck green on current generated types
  • The only consumer (buildNextTurnParamsContext) assigns request.models ?? [], which is exactly this type

Open in Devin Review

…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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant