mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
core: filter out alpha status models from provider list
This commit is contained in:
parent
4c674b075b
commit
ab8471a7ff
2 changed files with 15 additions and 11 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue