fix(core): load config across git boundaries (#36577)

Co-authored-by: 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 <little-frank@opencord.local>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot]
2026-07-13 00:05:41 +00:00
committed by GitHub
co-authored by 𝓛𝓲𝓽𝓽𝓵𝓮 𝓕𝓻𝓪𝓷𝓴 opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
parent 7e9b9cb0fd
commit f112a73c06
6 changed files with 17 additions and 40 deletions
@@ -999,37 +999,6 @@ it.instance("resolves scoped npm plugins in config", () =>
}),
)
it.effect("loads shared config above a child git repository", () =>
Effect.gen(function* () {
const root = yield* tmpdirScoped()
const global = yield* tmpdirScoped()
const workspace = path.join(root, "workspace")
const project = path.join(workspace, "project")
yield* writeConfigEffect(path.join(workspace, ".opencode"), {
model: "shared/model",
username: "shared-user",
})
yield* writeConfigEffect(path.join(project, ".opencode"), { username: "project-user" })
yield* Effect.promise(async () => {
const child = Bun.spawn(["git", "init"], { cwd: project, stdout: "ignore", stderr: "ignore" })
await child.exited
})
yield* withGlobalConfigDir(
global,
withInstanceDir(
project,
Effect.gen(function* () {
const config = yield* Config.use.get()
expect(config.model).toBe("shared/model")
expect(config.username).toBe("project-user")
}),
),
)
}),
)
it.effect("merges plugin arrays from global and local configs", () =>
withConfigTree(
{