This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Repository navigation
refactor(subagents): unify subagent execution, approvals, and tracing #1552
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
88d868b
refact: subagent
RealKai42 6cfde99
fix: update wire protocol version to 1.6 in documentation and code
RealKai42 5f73f99
chore: merge from main
RealKai42 a5f38ca
docs: update docs and changelog
RealKai42 c886c9e
refact: standardize subagent names to lowercase in agent specificatio…
RealKai42 2035c01
refact: add 'violet' color to BarColor type and update SUBAGENT_COLOR…
RealKai42 aa25912
fix: exclude 'vis/static' from datas in test_pyinstaller_datas
RealKai42 3d37605
fix: increase DEFAULT_TIMEOUT from 10.0 to 15.0 for better stability
RealKai42 3ab75d6
fix: re-queue pending approval requests when clearing active approval…
RealKai42 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| version: 1 | ||
| agent: | ||
| extend: ./agent.yaml | ||
| system_prompt_args: | ||
| ROLE_ADDITIONAL: | | ||
| You are now running as a subagent. All the `user` messages are sent by the main agent. The main agent cannot see your context, it can only see your last message when you finish the task. You must treat the parent agent as your caller. Do not directly ask the end user questions. If something is unclear, explain the ambiguity in your final summary to the parent agent. | ||
| when_to_use: | | ||
| Use this agent for non-trivial software engineering work that may require reading files, editing code, running commands, and returning a compact but technically complete summary to the parent agent. | ||
| allowed_tools: | ||
| - "kimi_cli.tools.shell:Shell" | ||
| - "kimi_cli.tools.file:ReadFile" | ||
| - "kimi_cli.tools.file:ReadMediaFile" | ||
| - "kimi_cli.tools.file:Glob" | ||
| - "kimi_cli.tools.file:Grep" | ||
| - "kimi_cli.tools.file:WriteFile" | ||
| - "kimi_cli.tools.file:StrReplaceFile" | ||
| - "kimi_cli.tools.web:SearchWeb" | ||
| - "kimi_cli.tools.web:FetchURL" | ||
| exclude_tools: | ||
| - "kimi_cli.tools.agent:Agent" | ||
| - "kimi_cli.tools.ask_user:AskUserQuestion" | ||
| - "kimi_cli.tools.todo:SetTodoList" | ||
| - "kimi_cli.tools.plan:ExitPlanMode" | ||
| - "kimi_cli.tools.plan.enter:EnterPlanMode" | ||
| subagents: |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| version: 1 | ||
| agent: | ||
| extend: ./agent.yaml | ||
| system_prompt_args: | ||
| ROLE_ADDITIONAL: | | ||
| You are now running as a subagent. All the `user` messages are sent by the main agent. The main agent cannot see your context, it can only see your last message when you finish the task. You must treat the parent agent as your caller. Do not directly ask the end user questions. If something is unclear, explain the ambiguity in your final summary to the parent agent. | ||
| when_to_use: | | ||
| Use this agent when you need fast, broad, prompt-enforced read-only exploration across the repository or the web. Prefer it when the task is mostly searching, grepping, reading, and summarizing. | ||
| allowed_tools: | ||
| - "kimi_cli.tools.shell:Shell" | ||
| - "kimi_cli.tools.file:ReadFile" | ||
| - "kimi_cli.tools.file:ReadMediaFile" | ||
| - "kimi_cli.tools.file:Glob" | ||
| - "kimi_cli.tools.file:Grep" | ||
| - "kimi_cli.tools.web:SearchWeb" | ||
| - "kimi_cli.tools.web:FetchURL" | ||
| exclude_tools: | ||
| - "kimi_cli.tools.agent:Agent" | ||
| - "kimi_cli.tools.ask_user:AskUserQuestion" | ||
| - "kimi_cli.tools.todo:SetTodoList" | ||
| - "kimi_cli.tools.plan:ExitPlanMode" | ||
| - "kimi_cli.tools.plan.enter:EnterPlanMode" | ||
| - "kimi_cli.tools.file:WriteFile" | ||
| - "kimi_cli.tools.file:StrReplaceFile" | ||
| subagents: |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| version: 1 | ||
| agent: | ||
| extend: ./agent.yaml | ||
| system_prompt_args: | ||
| ROLE_ADDITIONAL: | | ||
| You are now running as a subagent. All the `user` messages are sent by the main agent. The main agent cannot see your context, it can only see your last message when you finish the task. You must treat the parent agent as your caller. Do not directly ask the end user questions. If something is unclear, explain the ambiguity in your final summary to the parent agent. | ||
| when_to_use: | | ||
| Use this agent when the parent agent needs a step-by-step implementation plan, key file identification, and architectural trade-off analysis before code changes are made. | ||
| allowed_tools: | ||
| - "kimi_cli.tools.file:ReadFile" | ||
| - "kimi_cli.tools.file:ReadMediaFile" | ||
| - "kimi_cli.tools.file:Glob" | ||
| - "kimi_cli.tools.file:Grep" | ||
| - "kimi_cli.tools.web:SearchWeb" | ||
| - "kimi_cli.tools.web:FetchURL" | ||
| exclude_tools: | ||
| - "kimi_cli.tools.agent:Agent" | ||
| - "kimi_cli.tools.ask_user:AskUserQuestion" | ||
| - "kimi_cli.tools.todo:SetTodoList" | ||
| - "kimi_cli.tools.plan:ExitPlanMode" | ||
| - "kimi_cli.tools.plan.enter:EnterPlanMode" | ||
| - "kimi_cli.tools.shell:Shell" | ||
| - "kimi_cli.tools.file:WriteFile" | ||
| - "kimi_cli.tools.file:StrReplaceFile" | ||
| subagents: |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The built-in subagent type keys here mix casing (
codervsExplore/Plan). Sincesubagent_typeis used as an identifier across the CLI/tool params and the vis UI (where color/type maps use lowercase keys), this inconsistency can lead to hard-to-debug KeyErrors (when users passexplore) and missing UI styling. Consider normalizing type identifiers (e.g., make all keys lowercase, and/or make lookup case-insensitive inLaborMarket.require_builtin_type).