refactor(llm): move queryParams off model.native to typed field

Promotes queryParams to a first-class ModelRef field used by Endpoint.baseURL,
so deployment-level URL query params (Azure api-version, OpenAI-compatible
provider knobs) live in a typed home instead of an opaque `native` bag.

Also removes write-only dead fields from `native`:

- openaiCompatibleProvider (set by family helper, never read)
- opencodeProviderID, opencodeModelID (set by opencode bridge + native session
  builder, never read)
- npm (set by opencode bridge, never read)

After this commit `model.native` only carries genuinely provider-specific
opaque options that no other adapter cares about (Bedrock's aws_credentials
+ aws_region for SigV4). Drops the now-dead ProviderShared.queryParams
helper. Updates AGENTS.md doc on native is implicit through the new schema
JSDoc.
This commit is contained in:
Kit Langton
2026-04-28 19:48:33 -04:00
parent d8b9672234
commit f86a6790a2
11 changed files with 29 additions and 42 deletions
+1 -6
View File
@@ -134,14 +134,9 @@ export const toModelRef = (input: Input): ModelRef | undefined => {
baseURL: baseURL(input, resolution, options),
apiKey: apiKey(input, resolution, options),
headers: headers(input, options),
queryParams: resolution.queryParams,
capabilities: capabilities(input, resolution),
limits: LLM.limits({ context: input.model.limit.context, output: input.model.limit.output }),
native: {
opencodeProviderID: input.provider.id,
opencodeModelID: input.model.id,
npm: input.model.api.npm,
...(resolution.queryParams ? { queryParams: resolution.queryParams } : {}),
},
})
}
+1 -5
View File
@@ -249,11 +249,7 @@ export const request = Effect.fn("LLMNative.request")(function* (input: RequestI
toolChoice: input.toolChoice,
generation: input.generation,
metadata: input.metadata,
native: {
opencodeProviderID: input.provider.id,
opencodeModelID: input.model.id,
...input.native,
},
native: input.native,
})
})