Skip to content

Commit c649ed3

Browse files
committed
fix(config): load ~/.opencode before project dirs so project config wins
Global ~/.opencode was processed after project-local .opencode directories in the unique() array, causing global agent/model config to always override project-level overrides. Swap order so ~/.opencode is deduplicated early and project dirs are last (and win). Fixes: anomalyco#19296 Fixes: anomalyco#21307
1 parent e158118 commit c649ed3

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎packages/opencode/src/config/paths.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ export const directories = Effect.fn("ConfigPaths.directories")(function* (direc
2424
const afs = yield* AppFileSystem.Service
2525
return unique([
2626
Global.Path.config,
27+
...(yield* afs.up({
28+
targets: [".opencode"],
29+
start: Global.Path.home,
30+
stop: Global.Path.home,
31+
})),
2732
...(!Flag.OPENCODE_DISABLE_PROJECT_CONFIG
2833
? yield* afs.up({
2934
targets: [".opencode"],
3035
start: directory,
3136
stop: worktree,
3237
})
3338
: []),
34-
...(yield* afs.up({
35-
targets: [".opencode"],
36-
start: Global.Path.home,
37-
stop: Global.Path.home,
38-
})),
3939
...(Flag.OPENCODE_CONFIG_DIR ? [Flag.OPENCODE_CONFIG_DIR] : []),
4040
])
4141
})

0 commit comments

Comments
 (0)