Merge branch 'dev' into opentui

This commit is contained in:
Dax Raad 2025-10-15 21:20:50 -04:00
commit a6f3c1ecea
3 changed files with 15 additions and 13 deletions

View file

@ -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(),
})

View file

@ -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

View file

@ -518,8 +518,6 @@ export namespace MessageV2 {
}
if (msg.info.role === "assistant") {
const hasEmptyTextPart = msg.parts.some((part) => part.type === "text" && part.text.trim() === "")
if (hasEmptyTextPart) continue
result.push({
id: msg.info.id,
role: "assistant",