Skip to content

feat: add default_swarm_mode and subagent_model config options#774

Open
wintrover wants to merge 2 commits into
MoonshotAI:mainfrom
wintrover:feat/default-swarm-mode
Open

feat: add default_swarm_mode and subagent_model config options#774
wintrover wants to merge 2 commits into
MoonshotAI:mainfrom
wintrover:feat/default-swarm-mode

Conversation

@wintrover

Copy link
Copy Markdown

Changes

This PR adds two new configuration options to config.toml:

1. default_swarm_mode

Enables swarm mode by default, allowing automatic parallel subagent delegation.

default_swarm_mode = true

2. subagent_model

Allows overriding the model used by subagents independently from the parent agent's model.

default_model = "mimo-v2.5-pro"  # Parent agent uses pro
subagent_model = "mimo-v2.5"     # Subagents use non-pro

Motivation

  • Swarm mode: Reduces friction for users who primarily use parallel subagent workflows
  • Subagent model: Enables cost optimization by using a lighter model for subagents while keeping a more capable model for the main agent

Implementation

  • Added defaultSwarmMode and subagentModel to KimiConfigSchema
  • Added TOML serialization support in config/toml.ts
  • Added resolveSubagentModel() method to SessionSubagentHost that checks config.subagentModel first, falling back to parent's model
  • Updated all 4 subagent spawn/configure sites to use the new resolution logic

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)
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 650c710

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +17 to +18
if (agent.kimiConfig?.defaultSwarmMode === true) {
this.active = 'manual';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant