feat(core): add location-scoped config loading (#29625)

This commit is contained in:
Dax
2026-05-30 00:06:08 -04:00
committed by GitHub
parent 5fb85a6aa3
commit 9583e08be4
89 changed files with 3507 additions and 525 deletions

View File

@@ -0,0 +1,23 @@
import { describe, expect, test } from "bun:test"
import { Schema } from "effect"
import { ModelV2 } from "@opencode-ai/core/model"
import { ProviderV2 } from "@opencode-ai/core/provider"
const decode = Schema.decodeUnknownSync(ModelV2.Ref)
describe("ModelV2.Ref", () => {
test("accepts a model selection without a variant", () => {
expect(decode({ id: "claude-sonnet", providerID: "anthropic" })).toEqual({
id: ModelV2.ID.make("claude-sonnet"),
providerID: ProviderV2.ID.make("anthropic"),
})
})
test("preserves an explicit model variant", () => {
expect(decode({ id: "claude-sonnet", providerID: "anthropic", variant: "high" })).toEqual({
id: ModelV2.ID.make("claude-sonnet"),
providerID: ProviderV2.ID.make("anthropic"),
variant: ModelV2.VariantID.make("high"),
})
})
})