Skip to content

fix(cli): prioritize kilo config over opencode config#8781

Open
aravhawk wants to merge 1 commit intoKilo-Org:mainfrom
aravhawk:codex/fix-kilo-config-priority-7621
Open

fix(cli): prioritize kilo config over opencode config#8781
aravhawk wants to merge 1 commit intoKilo-Org:mainfrom
aravhawk:codex/fix-kilo-config-priority-7621

Conversation

@aravhawk
Copy link
Copy Markdown
Contributor

Summary

Fix config merge precedence so kilo.json / kilo.jsonc correctly override opencode.json / opencode.jsonc in all CLI config loading paths.

Root cause

The CLI loaded Kilo config files before Opencode config files in three places:

  • root project config loading
  • local config directories like .kilo/
  • global config loading

Because later merges win, that let opencode.* override kilo.*, which is backwards for Kilo CLI.

Changes

  • load opencode.json{,c} before kilo.json{,c} for project config resolution
  • load opencode.json{,c} before kilo.json{,c} for local config directory resolution
  • load opencode.json{,c} before kilo.json{,c} for global config resolution
  • add regression tests covering project, local .kilo, and global precedence

Validation

  • git push -u origin codex/fix-kilo-config-priority-7621
    • passed the repo's pre-push bun turbo typecheck
  • direct bun --eval repro from a temp repo confirmed kilo.json now wins while opencode.json still provides fallback fields
  • bun test test/config/config.test.ts
    • this runner shows unrelated baseline failures in this checkout, including existing config tests outside this change

Fixes #7621

Load opencode config files before kilo config files so kilo.json and
kilo.jsonc remain the authoritative override layer for both global
and project config resolution.

Add regression coverage for project, local .kilo, and global config
precedence to guard the merge order.

Fixes Kilo-Org#7621
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Apr 11, 2026

Code Review Summary

Status: 1 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

No inline-commentable issues; the remaining issue is outside the diff.

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
packages/opencode/src/config/config.ts 398 Managed config still loads kilo.* before opencode.*, so enterprise-managed opencode.json{,c} will continue to override kilo.json{,c}. That leaves the precedence bug unfixed for managed deployments.

Fix these issues in Kilo Cloud

Files Reviewed (2 files)
  • packages/opencode/src/config/config.ts - 1 issue
  • packages/opencode/test/config/config.test.ts - 0 issues

Reviewed by gpt-5.4-20260305 · 1,010,837 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): kilo.json should take priority over opencode.json in config loading

1 participant