Repository navigation
Closed
Description
Summary
Currently, subagents always inherit the parent agent's model — there is no way to configure them to use a different model than the main agent.
Current behavior (source-verified)
In packages/agent-core/src/session/subagent-host.ts, the configureChild method explicitly copies the parent's modelAlias:
// A subagent always inherits the parent agent's model.
child.config.update({
cwd: parent.config.cwd,
modelAlias: parent.config.modelAlias, // ← hardcoded inheritance
thinkingLevel: parent.config.thinkingLevel,
});The same pattern appears in resume(), retry(), and startBtw().
Additionally:
- Config schema (
config/schema.ts):KimiConfigSchemahas no subagent-model-related field - Agent tool input (
tools/builtin/collaboration/agent.ts):AgentToolInputSchemaaccepts nomodelparameter - Subagent profile schema (
profile/types.ts):RawSubagentProfileSchemaonly hasdescription
Desired behavior
Allow users to optionally specify a different model for subagents, so they can e.g.:
- Use a powerful/expensive model (
kimi-k2p6-turbo) for the main agent - Use a lighter/faster/cheaper model (
glm-5v-turbo) for coder/explore/plan subagents
Suggested approach
One clean option would be a new config section like:
[subagents]
model = "zai-coding-plan/glm-5v-turbo" # default for all subagent types
[subagents.coder]
model = "zai-coding-plan/glm-5v-turbo"
[subagents.explore]
model = "zai-coding-plan/glm-4.5-air" # even lighter for read-only tasksThis would require changes in:
KimiConfigSchema— add[subagents]table(s)AgentToolInputSchema— optional per-callmodeloverrideRawSubagentProfileSchema/ profile YAML — optional per-profilemodelSessionSubagentHost.configureChild()— use subagent-specific model instead of parent'smodelAlias
Use case / motivation
Users with access to multiple models often want to allocate compute strategically:
- The main agent drives high-level reasoning → benefits from a stronger model
- Subagents perform focused, scoped tasks (file reading, grep, targeted edits) → work well with faster/cheaper models
- This can significantly reduce cost and latency for sessions that spawn many subagents
Environment
- OS: Linux
- Version: kimi-code v0.11.0
Reacted by Jonatas Baldan, Suhyok Yoon and Oscar A. Virguez
Metadata
Metadata
Assignees
Labels
No labels
Activity
wintrover commentedon Jun 13, 2026
🛠️ Working Workaround: Runtime Subagent Model Override
While this issue gets addressed in source, here's a working runtime workaround that patches the bundled
main.mjsto support a[subagents]config section inconfig.toml.What it does
Injects a
resolveSubagentModel()function intoconfigureChild(),resume(),retry(), andstartBtw()— the 4 call sites whereparent.config.modelAliasis hardcoded.Setup
1. Add
[subagents]to~/.kimi-code/config.toml:2. Create the patch script at
~/.kimi-code/patches/apply.sh:3. Create auto-restore wrapper at
~/.npm-global/bin/kimi-wrapper.sh:4. Make
kimiuse the wrapper:How it works
kimiinvocation, the wrapper checks ifmain.mjsis still patchedkimi upgrade(which overwritesmain.mjs), the next invocation auto-reapplies the patchKIMI_SUBAGENT_MODELenv var >[subagents].modelin config.toml > parent model (fallback)[subagents.explore],[subagents.plan],[subagents.coder]sections can be added toresolveSubagentModel()Scope options
model = "mimo-v2.5"KIMI_SUBAGENT_MODEL=mimo-v2.5This is a practical workaround until the proper TypeScript source change lands in a release. Happy to help with the source-level PR if needed!
ieasir commentedon Jul 7, 2026
Strongly +1 this. This is not just a nice-to-have cost optimization; it is a strategic feature that would meaningfully expand Kimi Code's addressable user base.
Real-world use case: I want to run the main agent on a top-tier reasoning model like Claude 4.x for high-level architecture and planning, while dispatching subagents (coder/explore/plan) to Kimi or DeepSeek for the actual implementation work. Each layer is best served by a different model's strengths:
Without per-subagent model selection, the only workaround is to run separate manual sessions and copy results back, which breaks the unified agent-loop experience that makes Kimi Code compelling.
The user experience of Kimi Code is already comparable to Claude Code. Adding this would remove a major architectural limitation and make multi-model, multi-agent workflows practical out of the box. Would love to see this prioritized.
pctablet505 commentedon Jul 23, 2026
+1
if we have a superior model do the workflow management, and little models do mechanical work it becomes much cheaper, and faster without compromise in any quality. We shall definitely have this feature.