-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Subagents #149
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
base: main
Are you sure you want to change the base?
feat: Subagents #149
Conversation
| # Build tool groups summary | ||
| if (length(tool_groups) > 0) { | ||
| tool_summary <- paste( | ||
| "\n\nAvailable tool groups:", | ||
| paste(tool_groups, collapse = ", ") | ||
| ) |
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 intent here was to include individual tool names and a preview of the description, not just a list of tool group names.
R/tool-subagent.R
Outdated
| # Determine the tools to use (applying defaults) | ||
| configured_tools <- | ||
| tools %||% | ||
| getOption("btw.subagent.tools_default") %||% | ||
| getOption("btw.tools") |
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 problem with reading options here is that if an option is set via btw.md it's scope is just btw_client(), so by the time the the subagent tool runs and hits this code path, the options declared in btw.md have been unset. We'll need a way to create the tool attached via btw_client() such that it retains these options so they don't need to be check anew.
simonpcouch
left a comment
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.
This is stellar. Only providing the last assistant message as the output, allowing the main agent to configure which tools the subagent will access to, the tool UI, etc.
The only additional feature that I might consider is allowing the main agent to toggle whether the subagent should inherit the turns from the main agent. There are many situations where I'm fine to pay for the cost of the subagents "re-reading" tokens in exchange for it knowing enough to do the task right.
Create a hierarchical agent workflow system that allows an orchestrating LLM agent to delegate tasks to specialized subagents with their own LLM chat sessions. Subagents maintain conversation state, can be resumed across multiple tool calls, and have configurable tool access.
Quick summary of features
btw.subagent.clientto choose the ellmer client,btw.subagent.tools_defaultfor default attached tools andbtw.subagent.tools_allowedto limit to specific allowed tools in subagents.Note: these options currently only work as R options and aren't supported in
btw.md(yet)