diff --git a/.changeset/next-turn-models-type.md b/.changeset/next-turn-models-type.md new file mode 100644 index 00000000..987b83d3 --- /dev/null +++ b/.changeset/next-turn-models-type.md @@ -0,0 +1,5 @@ +--- +'@openrouter/agent': patch +--- + +Type `NextTurnParamsContext.models` as `NonNullable` instead of a hand-written `string[]`. It now follows the SDK's generated request type: `string[]` today, and reason-gated fallback entries once the SDK spec regenerates. With the current SDK there is no type change. diff --git a/packages/agent/src/lib/tool-types.ts b/packages/agent/src/lib/tool-types.ts index 90ce6671..8c10a87f 100644 --- a/packages/agent/src/lib/tool-types.ts +++ b/packages/agent/src/lib/tool-types.ts @@ -300,8 +300,12 @@ export type NextTurnParamsContext = { toolChoice: models.ResponsesRequest['toolChoice']; /** Current model selection */ model: string; - /** Current models array */ - models: string[]; + /** + * Current models array (fallback model IDs, or reason-gated fallback + * entries once the SDK spec includes them). Derived from the SDK request + * type so it tracks the generated shape. + */ + models: NonNullable; /** Current temperature */ temperature: number | null; /** Current maxOutputTokens */