feat(core): widen interleaved reasoning fields

This commit is contained in:
Aiden Cline 2026-07-18 11:11:45 -05:00
commit f28cc51f12
13 changed files with 140 additions and 37 deletions

View file

@ -1,4 +1,5 @@
import { describe, expect, test } from "bun:test"
import { Schema } from "effect"
import { Model } from "../src/model.js"
describe("Model.Ref", () => {
@ -20,3 +21,13 @@ describe("Model.Ref", () => {
expect(() => Model.Ref.parse("openai/gpt-5#high#extra")).toThrow()
})
})
describe("Model.Interleaved", () => {
test("accepts known and provider-specific fields", () => {
const decode = Schema.decodeUnknownSync(Model.Interleaved)
const fields = ["reasoning", "reasoning_content", "reasoning_text", "reasoning_details", "vendor_reasoning"]
for (const field of fields) expect(decode({ field })).toEqual({ field })
expect(decode(true)).toBe(true)
})
})