feat: add default_swarm_mode and subagent_model config options#774
feat: add default_swarm_mode and subagent_model config options#774wintrover wants to merge 2 commits into
Conversation
Add `default_swarm_mode` boolean to kimi-code config that automatically enters swarm mode on session start. Changes: - schema.ts: Add defaultSwarmMode field to KimiConfigSchema and KimiConfigPatchSchema - toml.ts: Add 'defaultSwarmMode' to scalarFields array for TOML serialization - swarm/index.ts: Check defaultSwarmMode in constructor, set active='manual' when true - build.sh: Add build/deploy automation script When default_swarm_mode = true in config.toml, the SwarmMode constructor sets trigger to 'manual' (persistent, no auto-exit).
Add `subagent_model` config option that allows setting a different model for all subagents, decoupled from the parent agent's model. Changes: - schema.ts: Add subagentModel field to KimiConfigSchema and KimiConfigPatchSchema - toml.ts: Add 'subagentModel' to scalarFields array for TOML serialization - subagent-host.ts: Add resolveSubagentModel() helper, replace all 4 hardcoded parent.config.modelAlias inheritance sites to use config override when present Resolution logic: config.subagentModel set? → use it for all subagents not set? → inherit parent's model (existing behavior, no change)
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 650c7103db
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (agent.kimiConfig?.defaultSwarmMode === true) { | ||
| this.active = 'manual'; |
There was a problem hiding this comment.
Initialize default swarm mode through the normal entry path
When default_swarm_mode is true this only flips active to manual, but skips the side effects in enter('manual'): the swarm-mode system reminder is never appended, no swarm_mode.enter record is written, and no status update is emitted. In a fresh session the UI/RPC reports swarm mode as active and AgentSwarm approval is relaxed, but the model never receives the workflow instructions that /swarm on would inject, so the new default does not actually enable automatic parallel delegation.
Useful? React with 👍 / 👎.
Changes
This PR adds two new configuration options to
config.toml:1.
default_swarm_modeEnables swarm mode by default, allowing automatic parallel subagent delegation.
2.
subagent_modelAllows overriding the model used by subagents independently from the parent agent's model.
Motivation
Implementation
defaultSwarmModeandsubagentModeltoKimiConfigSchemaconfig/toml.tsresolveSubagentModel()method toSessionSubagentHostthat checksconfig.subagentModelfirst, falling back to parent's model