mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-09 23:58:31 +00:00
feat(core): honor default session models (#30982)
This commit is contained in:
parent
f26a9e8856
commit
d2204e0ff5
8 changed files with 93 additions and 15 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue