fix(cli): preserve configured subagent routing - #12652
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Incremental review at Files Reviewed (4 files)
Previous Review Summaries (2 snapshots, latest commit ae17dea)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit ae17dea)Status: No Issues Found | Recommendation: Merge The previously flagged WARNING (mergeAgentMarkdown's guard could not distinguish a real config-defined agent from an earlier markdown-defined one) is resolved in this update: config-defined agents are now tracked separately in a Files Reviewed (4 files)
Previous review (commit 43c6d82)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (4 files)
Reviewed by claude-opus-5 · Input: 26 · Output: 4.7K · Cached: 600.7K Review guidance: REVIEW.md from base branch |
|
Thanks for taking this on, and for the thorough verification writeup. The fix targets the right layer: resolving the collision at config merge time keeps config-defined routing intact instead of patching around it in the task tool. I re-ran the collision scenario locally against this branch (config subagent + marketplace-style primary markdown with the same slug) and the subagent stays routable with its configured model, prompt, and description. Merging. Two follow-ups worth tracking separately: surfacing a config warning when a collision is resolved this way, and revisiting the marketplace installer's same-scope kilo.json entry deletion, which is now the remaining path that can silently drop a configured agent. |
|
@marius-kilocode Thank you for the approval. I merged the latest |
|
@marius-kilocode The latest workflow is red because |
|
CI update: the unit shard failure was flake and passed on re-run, but the HttpApi exerciser now times out consistently. That is not on your change: your branch is based on v7.4.17, and main got a fix for the exerciser hanging on blocking auth probes today (280c117, "fix(cli): stop HttpApi exerciser hanging on blocking auth probes"). I reproduced the same hang locally on your branch, and each exerciser mode passes individually once the hang cause is absent. Can you merge current main into your branch (or rebase onto it)? Auto-merge stays enabled, and I will approve the fresh CI runs as soon as the push lands. |
|
@marius-kilocode Done — I merged the current main into the branch and pushed b0d506e. The focused routing suite still passes locally (62 tests), the PR diff remains limited to the original four files, and fresh CI is running now. Thanks for the guidance and for re-reviewing once the checks settle. |
|
@marius-kilocode The required test workflow failed again on this PR in This attempt reported eight failures across three unrelated test files, mostly 15–30 second timeouts followed by cascading config-overlay errors. The previous attempt failed the same Windows shard on a different session HttpApi timeout, which suggests the shard is flaky rather than the failures being specific to this PR. I tried to rerun only the failed jobs with |
|
@marius-kilocode This PR is approved and the latest CI failure is limited to the flaky |
* fix(cli): preserve configured subagent routing * fix(cli): preserve markdown agent precedence * ci: rerun checks

Summary
alldefault) when a later discovered Marketplace agent markdown file has the same slug and declaresmode: primarysubagentmode and config-only custom-agent default routing@kilocode/cliFixes #12638
Verification
bun test ./test/kilocode/agent-routing.test.ts ./test/kilocode/agent-permission-overrides.test.ts ./test/agent/agent.test.ts— 61 passedbun run typecheckinpackages/opencode— passedbun run lint— passed (0 errors; existing warnings only)bun run script/check-opencode-annotations.ts --worktree— passedgit diff --check— passedarchitectsubagent and a colliding Marketplace-style primary agent — request route wasprimary-proof -> subagent-proof -> primary-proofThe repository-wide typecheck reached the unrelated JetBrains package but could not run it because Java 21 is not installed in the local environment. The non-JetBrains typecheck completed successfully.
A screen recording and still screenshot of the isolated end-to-end proof are attached in a PR comment.