mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-21 11:53:34 +00:00
fix(core): tolerate missing models.dev temperature
This commit is contained in:
parent
bf3ae45439
commit
34a08cbdb8
2 changed files with 17 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ export const Model = Schema.Struct({
|
|||
attachment: Schema.Boolean,
|
||||
reasoning: Schema.Boolean,
|
||||
reasoning_options: Schema.optional(Schema.Array(ReasoningOption)),
|
||||
temperature: Schema.Boolean,
|
||||
temperature: Schema.optional(Schema.Boolean),
|
||||
tool_call: Schema.Boolean,
|
||||
interleaved: Schema.optional(
|
||||
Schema.Union([
|
||||
|
|
|
|||
|
|
@ -149,6 +149,22 @@ describe("ModelsDev Service", () => {
|
|||
}),
|
||||
)
|
||||
|
||||
it.effect("allows models.dev entries without temperature metadata", () =>
|
||||
Effect.sync(() => {
|
||||
const result = Schema.decodeUnknownSync(ModelsDev.Model)({
|
||||
id: "no-temperature-model",
|
||||
name: "No Temperature Model",
|
||||
release_date: "2026-01-01",
|
||||
attachment: false,
|
||||
reasoning: false,
|
||||
tool_call: true,
|
||||
limit: { context: 128000, output: 8192 },
|
||||
})
|
||||
|
||||
expect(result.temperature).toBeUndefined()
|
||||
}),
|
||||
)
|
||||
|
||||
it.live("get() returns providers from disk when cache file exists", () =>
|
||||
Effect.gen(function* () {
|
||||
yield* writeCache(fixture)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue