fix(core): accept deprecated reference config key (#31659)

This commit is contained in:
Luke Parker 2026-06-10 20:32:35 +10:00 committed by GitHub
commit 90fb32be30
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 69 additions and 2 deletions

View file

@ -722,6 +722,26 @@ it.instance("migrates mode field to agent field", () =>
}),
)
it.instance("accepts the deprecated reference field", () =>
Effect.gen(function* () {
const test = yield* TestInstance
yield* writeConfigEffect(test.directory, {
$schema: "https://opencode.ai/config.json",
reference: {
local: { path: "../library" },
sdk: { repository: "github.com/example/sdk", branch: "main" },
shorthand: "github.com/example/docs",
},
})
const config = yield* Config.use.get()
expect(config.reference).toEqual({
local: { path: "../library" },
sdk: { repository: "github.com/example/sdk", branch: "main" },
shorthand: "github.com/example/docs",
})
}),
)
it.instance("loads config from .opencode directory", () =>
Effect.gen(function* () {
const test = yield* TestInstance