feat(core): honor default session models (#30982)

This commit is contained in:
Kit Langton 2026-06-05 12:10:48 -04:00 committed by GitHub
parent f26a9e8856
commit d2204e0ff5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 93 additions and 15 deletions

View file

@ -52,6 +52,20 @@ const provider = {
}
describe("Config", () => {
it.effect("returns the latest defined scalar from priority-ordered documents", () =>
Effect.sync(() => {
const entries = [
new Config.Document({ type: "document", info: new Config.Info({ model: "openrouter/openai/gpt-5" }) }),
new Config.Directory({ type: "directory", path: AbsolutePath.make("/skills") }),
new Config.Document({ type: "document", info: new Config.Info({}) }),
new Config.Document({ type: "document", info: new Config.Info({ model: "openrouter/openai/gpt-5.5" }) }),
]
expect(Config.latest(entries, "model")).toBe("openrouter/openai/gpt-5.5")
expect(Config.latest(entries, "default_agent")).toBeUndefined()
}),
)
it.effect("detects v1 configuration from any v1-only top-level key", () =>
Effect.sync(() => {
expect(ConfigMigrateV1.isV1({ snapshot: false })).toBe(true)