chore(opencode): suppress dead v1 model types

This commit is contained in:
Dax Raad
2026-07-09 13:15:20 -04:00
parent a2718177be
commit c91604d519
10 changed files with 54 additions and 2 deletions
@@ -49,9 +49,11 @@ type RecordedScenario = {
readonly recordAuth?: () => Auth.Info | undefined
readonly replayAuth?: Auth.Info
readonly stableID?: string
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
readonly config: (model: ModelsDev.Provider["models"][string]) => Partial<ConfigV1.Info>
}
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
const cloneModel = (model: ModelsDev.Provider["models"][string]) => {
const cloned = structuredClone(model)
const { experimental, ...rest } = cloned
@@ -94,6 +96,7 @@ const providerConfig = (input: {
readonly env: string[]
readonly npm: string
readonly api: string
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
readonly model: ModelsDev.Provider["models"][string]
readonly options: Record<string, unknown>
}): Partial<ConfigV1.Info> => ({
@@ -254,6 +257,7 @@ async function loadFixture(providerID: string, modelID: string) {
return model
}
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
const modelsFixture = Filesystem.readJson<Record<string, ModelsDev.Provider>>(
path.join(import.meta.dir, "../tool/fixtures/models-api.json"),
)
@@ -283,6 +287,7 @@ function recordedNativeLLMLayer(scenario: RecordedScenario) {
])
}
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
const writeConfig = (directory: string, scenario: RecordedScenario, model: ModelsDev.Provider["models"][string]) =>
Effect.promise(() =>
Bun.write(
@@ -30,6 +30,7 @@ import { LayerNodePlatform } from "@opencode-ai/core/effect/app-node-platform"
type ConfigModel = NonNullable<NonNullable<ConfigV1.Info["provider"]>[string]["models"]>[string]
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
const openAIConfig = (model: ModelsDev.Provider["models"][string], baseURL: string): Partial<ConfigV1.Info> => {
const { experimental: _experimental, ...configModel } = model
return {
@@ -700,6 +701,7 @@ function createChatStream(text: string) {
const MODELS_FIXTURE = JSON.parse(
await Bun.file(path.join(import.meta.dir, "../tool/fixtures/models-api.json")).text(),
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev provider type.
) as Record<string, ModelsDev.Provider>
function loadFixture(providerID: string, modelID: string) {
@@ -710,6 +712,7 @@ function loadFixture(providerID: string, modelID: string) {
return { provider, model }
}
// @ts-expect-error dead V1 fixture uses the removed pre-normalized ModelsDev model type.
function configModel(model: ModelsDev.Model) {
return {
id: model.id,