-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Prioritize opencode config files over kilo config files #8756
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -280,7 +280,7 @@ export namespace Config { | |
| // Project config overrides global and remote config. | ||
| if (!Flag.KILO_DISABLE_PROJECT_CONFIG) { | ||
| // kilocode_change start | ||
| for (const file of ["kilo.jsonc", "kilo.json", "opencode.jsonc", "opencode.json"]) { | ||
| for (const file of ["opencode.jsonc", "opencode.json", "kilo.jsonc", "kilo.json"]) { | ||
| try { | ||
| result = mergeConfigConcatArrays(result, await loadFile(file)) | ||
| } catch (err) { | ||
|
|
@@ -311,7 +311,7 @@ export namespace Config { | |
| dir.endsWith(".opencode") || | ||
| dir === Flag.KILO_CONFIG_DIR | ||
| ) { | ||
| for (const file of ["kilo.jsonc", "kilo.json", "opencode.jsonc", "opencode.json"]) { | ||
| for (const file of ["opencode.jsonc", "opencode.json", "kilo.jsonc", "kilo.json"]) { | ||
| log.debug(`loading config from ${path.join(dir, file)}`) | ||
| try { | ||
| result = mergeConfigConcatArrays(result, await loadFile(path.join(dir, file))) | ||
|
|
@@ -369,7 +369,7 @@ export namespace Config { | |
| // This way it only loads config file and not skills/plugins/commands | ||
| if (existsSync(managedDir)) { | ||
| // kilocode_change start | ||
| for (const file of ["kilo.jsonc", "kilo.json", "opencode.jsonc", "opencode.json"]) { | ||
| for (const file of ["opencode.jsonc", "opencode.json", "kilo.jsonc", "kilo.json"]) { | ||
| result = mergeConfigConcatArrays(result, await loadFile(path.join(managedDir, file))) | ||
| } | ||
| // kilocode_change end | ||
|
|
@@ -1545,12 +1545,12 @@ export namespace Config { | |
| let result: Info = pipe( | ||
| {}, | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "config.json"))), | ||
| // kilocode_change start | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "kilo.json"))), | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "opencode.jsonc"))), | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "opencode.json"))), | ||
| // kilocode_change start — kilo files loaded last so they take priority | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "kilo.jsonc"))), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Global precedence is reversed here too In this |
||
| mergeDeep(await loadFile(path.join(Global.Path.config, "kilo.json"))), | ||
| // kilocode_change end | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "opencode.json"))), | ||
| mergeDeep(await loadFile(path.join(Global.Path.config, "opencode.jsonc"))), | ||
| ) | ||
|
|
||
| const legacy = path.join(Global.Path.config, "config") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: This reorder still gives
kilo.*higher precedencemergeConfigConcatArrays(result, await loadFile(file))treats the newly loaded file as the overriding source, so the last filename in this array wins. Withopencode.*first andkilo.*last, a repo that has both files will still apply the legacykilovalues over theopencodeones. The same ordering issue also affects the directory and managed-directory loops below.