MoonshotAI / MoonshotAI/kimi-code

feat: support per-call model and thinking_level parameters in Agent and AgentSwarm tools

Open
#2,140 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.5k
Forks
1.2k
Avg merge
11h 53m
Merged PRs (30d)
350

Description

What feature would you like to see?

With the release of Kimi K3 (which introduces variable thinking efforts: low, high, max) alongside models like K2.7 (kimi-for-coding / highspeed), subagent collaboration via Agent and AgentSwarm tools currently forces all child agents to inherit the parent session's default model and default thinking effort level.

In multi-agent architectures:

  1. Cost & Token Efficiency: Running every subagent on high thinking or K3 for simple tasks (such as single-file pattern searches, glob lookups, or minor formatting edits) consumes excessive context and reasoning tokens unnecessarily.
  2. Execution Speed: Lightweight tasks (e.g. codebase exploration) benefit from fast execution (thinking_level: "low" or model: "kimi-for-coding-highspeed"), while complex architecture refactoring needs thinking_level: "high" or "max".
Proposed Solution

Add explicit optional parameters to Agent and AgentSwarm tool schemas:

  • thinking_level: z.enum(['off', 'low', 'medium', 'high', 'xhigh', 'max']).optional() — Overrides parent session thinking effort for the subagent call.
  • model: z.string().optional() — Overrides parent session model / model alias for the subagent call (e.g., "k3", "kimi-for-coding-highspeed").
Precedence Resolution Chain
  1. Per-call tool argument: args.thinking_level / args.model (highest precedence)
  2. Subagent profile default: profile.thinking_level / profile.model (e.g., explore.yaml setting thinking_level: low)
  3. Parent session default: parent.config.thinkingEffort / parent.config.modelAlias (fallback)
Additional information
  • This enables coordinator agents to dynamically select model tiers and thinking depth based on task scope and complexity.
  • We have validated this pattern in custom profile directory workflows (--agents-dir), drastically reducing token consumption and latency in multi-agent swarms.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Agent and AgentSwarm tool schemas, then trace how subagent profiles and parent session defaults are resolved. Verify that per-call model and thinking_level values take precedence over profile and parent defaults, and confirm the schemas support the listed optional values.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.