fix(kiloclaw): preserve Brave config when provider is unset#2723
fix(kiloclaw): preserve Brave config when provider is unset#2723
Conversation
| const shouldForceExa = kiloExaSearchMode === 'kilo-proxy'; | ||
| const shouldAutoAssignExa = kiloExaSearchMode === 'unset' && !hasExplicitSearchProvider; | ||
| const shouldAutoAssignExa = | ||
| kiloExaSearchMode === 'unset' && !hasExplicitSearchProvider && !braveConfigured; |
There was a problem hiding this comment.
WARNING: Leaving the provider unset still allows Kilo Exa to win auto-detection
createKiloExaWebSearchProvider() is always registered and advertises envVars: ['KILOCODE_API_KEY'] with autoDetectOrder, and every KiloClaw machine has KILOCODE_API_KEY. In the Brave-configured case this branch now stops writing tools.web.search.provider, but it never explicitly selects brave or disables the customizer provider, so the runtime can still auto-select kilo-exa when the provider is missing. That means the restore/doctor path here does not reliably preserve Brave search despite the new regression tests passing.
There was a problem hiding this comment.
Good catch, this was valid.
I changed the unset-mode + Brave-configured path to explicitly prefer Brave (instead of leaving provider unset):
tools.web.search.provider = 'brave'plugins.entries.kiloclaw-customizer.config.webSearch.enabled = false
Also updated regression tests for both normal and restore paths and re-ran:
pnpm -C services/kiloclaw test -- controller/src/config-writer.test.tspnpm typecheckpnpm format
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by gpt-5.4-20260305 · 527,726 tokens |
|
Added the requested PR1 tightening:
Invariant remains: explicit provider strings are not clobbered by upgrade defaulting logic. |
Summary
Preserves user-configured Brave search on image upgrades when the web search provider field is unset.
The controller config patcher no longer auto-assigns
kilo-exawhenKILO_EXA_SEARCH_MODEis unset ifBRAVE_API_KEYis already configured. This keeps existing Brave configurations from being implicitly overridden during bootstrap/doctor/restore patching.Added regression coverage for both normal config generation and restore-path config generation.
Verification
Visual Changes
N/A
Reviewer Notes
Primary risk area is
generateBaseConfig()web-search steering logic in controller boot patching.Behavior for explicit providers and explicit Exa mode values is unchanged.