Skip to content

Always add subagent tool#57

Open
e4t wants to merge 1 commit into
mark3labs:masterfrom
e4t:always_add_subagent_tool
Open

Always add subagent tool#57
e4t wants to merge 1 commit into
mark3labs:masterfrom
e4t:always_add_subagent_tool

Conversation

@e4t

@e4t e4t commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

This update adds the subagent tool even if core tools are disabled. The subagent is purely internal and may be useful to parallelize tasks in chats or when using external MCP tools only.

It can be debated whether an option should be added for this.
Please let me know!

Summary by CodeRabbit

  • Documentation
    • Clarified the core tools disable option behavior: when disabled, the subagent tool remains available for chat-only usage instead of being fully removed.
    • Updated SDK documentation and configuration references across all platforms for consistency.

@mark-iii-labs-huly

Copy link
Copy Markdown

Connected to Huly®: KIT-58

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bec820eb-82a3-41d9-aecd-6c9701d72404

📥 Commits

Reviewing files that changed from the base of the PR and between 88d59f8 and 5713314.

📒 Files selected for processing (8)
  • README.md
  • internal/agent/agent.go
  • internal/agent/factory.go
  • internal/core/tools.go
  • internal/kitsetup/setup.go
  • pkg/kit/README.md
  • skills/kit-sdk/SKILL.md
  • www/pages/sdk/options.md
✅ Files skipped from review due to trivial changes (5)
  • skills/kit-sdk/SKILL.md
  • internal/kitsetup/setup.go
  • internal/agent/factory.go
  • pkg/kit/README.md
  • www/pages/sdk/options.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • README.md
  • internal/agent/agent.go
  • internal/core/tools.go

📝 Walkthrough

Walkthrough

This PR clarifies the DisableCoreTools behavior by ensuring chat-only mode initializes with the subagent tool instead of an empty toolset. A new SubagentTool() helper is added, the agent initialization is updated to use it, and documentation across internal comments and user-facing files is harmonized to explain this behavior consistently.

Changes

Subagent tool initialization and helper

Layer / File(s) Summary
SubagentTool helper factory
internal/core/tools.go
New exported SubagentTool() helper returns a one-element slice wrapping NewSubagentTool(opts...).
Agent initialization with subagent tool
internal/agent/agent.go
When DisableCoreTools is true and CoreTools is empty, NewAgent now initializes coreTools using core.SubagentTool() instead of nil.

Documentation updates for DisableCoreTools behavior

Layer / File(s) Summary
Internal configuration documentation
internal/agent/agent.go, internal/agent/factory.go, internal/kitsetup/setup.go
DisableCoreTools field comments are clarified to document that enabling it (when CoreTools is empty) leaves only the subagent tool available, not zero tools.
Public SDK and README documentation
README.md, pkg/kit/README.md, skills/kit-sdk/SKILL.md, www/pages/sdk/options.md
README files and SDK documentation update DisableCoreTools descriptions to state that disabling core tools keeps only the subagent tool for chat-only usage, replacing prior "zero tools" wording.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • mark3labs/kit#35: Implements the DisableCoreTools behavior by wiring the flag/config through CLI and Viper into AgentSetupOptions, ensuring core tools are disabled except for the subagent when initialized in chat-only mode.
  • mark3labs/kit#51: Adjusts subagent toolset construction by filtering out the "subagent" tool when subagents inherit parent tools, complementing this PR's approach of isolating the subagent tool in chat-only mode.

Poem

🐰 A chat-only agent hops alone,
With just the subagent by its side,
No core tools clutter—clean and known,
The helper function opens wide!
Docs now sing in harmony's song,
Clarity rings: you need one tool to belong.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Always add subagent tool' directly and clearly summarizes the main change in the PR: ensuring the subagent tool is added even when core tools are disabled.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/agent/agent.go`:
- Around line 295-297: The comment is inaccurate: when
agentConfig.DisableCoreTools is true and agentConfig.CoreTools is empty the code
sets coreTools = core.SubagentTool(), which provides one subagent tool rather
than zero tools; update the comment above that block to state that it enables
chat-only mode except for the subagent tool (or explicitly mention "one subagent
tool provided via core.SubagentTool()") so the comment matches the behavior of
agentConfig.DisableCoreTools, agentConfig.CoreTools, and coreTools.

In `@internal/core/tools.go`:
- Around line 103-107: The SubagentTool function body uses inconsistent
indentation; open the function containing SubagentTool (and its call to
NewSubagentTool) and reformat the block to use Go's standard tab indentation for
all lines inside the function body so tabs replace any spaces and indentation is
consistent with gofmt; then run gofmt or goimports to ensure the final
formatting is canonical.

In `@README.md`:
- Around line 594-597: The README contains inconsistent documentation about
DisableCoreTools and the --no-core-tools flag: the inline comment for
DisableCoreTools: true says it disables built-in core tools "except for the
subagent tool", while the CLI Reference entry for --no-core-tools lists subagent
as disabled; update the docs to be consistent by clarifying the intended
behavior and making both places match — either change the inline comment for
DisableCoreTools (and mention KIT_NO_CORE_TOOLS / no-core-tools in .kit.yml) to
state that subagent remains enabled, or edit the CLI Reference description for
--no-core-tools to note that subagent is excluded from the disable list,
ensuring both DisableCoreTools, --no-core-tools, KIT_NO_CORE_TOOLS, and
no-core-tools entries use the same phrasing about subagent availability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fcb882db-8d83-4b8d-b301-5cdbfb6be061

📥 Commits

Reviewing files that changed from the base of the PR and between ef072f6 and 291f60b.

📒 Files selected for processing (10)
  • README.md
  • internal/agent/agent.go
  • internal/agent/factory.go
  • internal/core/subagent.go
  • internal/core/tools.go
  • internal/kitsetup/setup.go
  • pkg/kit/README.md
  • pkg/kit/kit.go
  • skills/kit-sdk/SKILL.md
  • www/pages/sdk/options.md

Comment thread internal/agent/agent.go
Comment thread internal/core/tools.go
Comment thread README.md
@e4t e4t force-pushed the always_add_subagent_tool branch from 291f60b to 88d59f8 Compare June 10, 2026 06:27
The subagent tool is a purely internal tool spawning subagents.
It may still be useful even when only chatting to parallelize
tasks or when using external (MCP) tools.

Signed-off-by: Egbert Eich <[email protected]>
@e4t e4t force-pushed the always_add_subagent_tool branch from 88d59f8 to 5713314 Compare June 10, 2026 06:43
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