feat: support a configurable secondary model for subagents#2064
Draft
7Sageer wants to merge 1 commit into
Draft
Conversation
🦋 Changeset detectedLatest commit: d2ce676 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
7Sageer
force-pushed
the
feat-subagent-k27
branch
from
July 22, 2026 15:02
2dc8bf8 to
d2ce676
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
No GitHub issue — the requirement comes from an internal design doc ("主子 Agent 模型定义", Moonshot Feishu wiki). The problem is explained below.
Problem
Subagents always inherit the calling agent's model. Users who want to save cost or capacity on a strong primary model have no way to run subagents on a cheaper secondary model: there is no configuration surface for a per-purpose model, and the main agent cannot choose a different model per spawn. Fork agents must keep using the parent's model (they share context), so the choice only applies to fresh spawns.
What changed
[subagent] model/effortfields inconfig.toml, withKIMI_SUBAGENT_MODEL/KIMI_SUBAGENT_EFFORTenv overrides (env wins and is never persisted). The value is any configured model alias, so the secondary model is not limited to Kimi models.Agent/AgentSwarmspawns bind the secondary model (and optional effort) by default; both tools gain amodelparameter ("subagent"|"primary") and advertise the two concrete aliases in their descriptions so the main agent can pick per spawn. When nothing is configured, spawning behavior is byte-for-byte unchanged (subagents inherit the caller's model)./init, main-model resolution, and legacyagent-coreare unchanged. No automatic default secondary model is wired in this phase (explicit configuration only).Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.