mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-30 22:24:19 +01:00
core: filter out alpha status models from provider list
This commit is contained in:
@@ -35,6 +35,7 @@ export namespace ModelsDev {
|
||||
})
|
||||
.optional(),
|
||||
experimental: z.boolean().optional(),
|
||||
status: z.enum(["alpha", "beta"]).optional(),
|
||||
options: z.record(z.string(), z.any()),
|
||||
provider: z.object({ npm: z.string() }).optional(),
|
||||
})
|
||||
|
||||
@@ -270,17 +270,17 @@ export namespace Provider {
|
||||
cost:
|
||||
!model.cost && !existing?.cost
|
||||
? {
|
||||
input: 0,
|
||||
output: 0,
|
||||
cache_read: 0,
|
||||
cache_write: 0,
|
||||
}
|
||||
input: 0,
|
||||
output: 0,
|
||||
cache_read: 0,
|
||||
cache_write: 0,
|
||||
}
|
||||
: {
|
||||
cache_read: 0,
|
||||
cache_write: 0,
|
||||
...existing?.cost,
|
||||
...model.cost,
|
||||
},
|
||||
cache_read: 0,
|
||||
cache_write: 0,
|
||||
...existing?.cost,
|
||||
...model.cost,
|
||||
},
|
||||
options: {
|
||||
...existing?.options,
|
||||
...model.options,
|
||||
@@ -361,7 +361,10 @@ export namespace Provider {
|
||||
modelID !== "gpt-5-chat-latest" && !(providerID === "openrouter" && modelID === "openai/gpt-5-chat"),
|
||||
)
|
||||
// Filter out experimental models
|
||||
.filter(([, model]) => !model.experimental || Flag.OPENCODE_ENABLE_EXPERIMENTAL_MODELS),
|
||||
.filter(
|
||||
([, model]) =>
|
||||
(!model.experimental && model.status !== "alpha") || Flag.OPENCODE_ENABLE_EXPERIMENTAL_MODELS,
|
||||
),
|
||||
)
|
||||
provider.info.models = filteredModels
|
||||
|
||||
|
||||
Reference in New Issue
Block a user