-
Notifications
You must be signed in to change notification settings - Fork 915
fix: inherit custom tools in subagents #330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@moonshot-ai/agent-core": patch | ||
| "@moonshot-ai/kimi-code": patch | ||
| --- | ||
|
|
||
| Allow subagents to use custom tools registered on their parent agent. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -287,6 +287,7 @@ export class SessionSubagentHost { | |
|
|
||
| const context = await prepareSystemPromptContext(child.kaos); | ||
| child.useProfile(profile, context); | ||
| child.tools.inheritUserTools(parent.tools); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the parent has an active side-effecting custom tool, this unconditional inheritance gives it to every subagent profile after Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This inheritance is only invoked from Useful? React with 👍 / 👎. |
||
| } | ||
|
|
||
| private async triggerSubagentStart( | ||
|
|
||
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.
Because inheritance registers a separate active copy on the child, a subagent keeps this custom tool even after the parent later calls
unregisterToolorsetActiveToolsto remove it. In sessions where a subagent is resumed or still running in the background after the parent disables a desktop-provided tool, the LLM can still see and call the stale child copy, so tool availability no longer matches the parent’s current active tools. Please keep inherited user tools synchronized or avoid persisting an independent active registration on the child.Useful? React with 👍 / 👎.