fix(delegate): expand composite toolsets before intersection in delegate_task#19455
Closed
luyao618 wants to merge 1 commit into
Closed
fix(delegate): expand composite toolsets before intersection in delegate_task#19455luyao618 wants to merge 1 commit into
luyao618 wants to merge 1 commit into
Conversation
…ate_task When the parent agent uses a composite toolset like hermes-cli, calling delegate_task with individual toolsets (e.g. web, terminal) resulted in zero tools because the name-based intersection failed: 'web' != 'hermes-cli'. Add _expand_parent_toolsets() which collects all tool names from parent toolsets, then recognises any individual toolset whose tools are a subset of the parent's available tools. This allows delegate_task(toolsets=['web']) to work correctly when the parent has hermes-cli enabled. Fixes NousResearch#19447
0290136 to
f84aff3
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixes #19447
When the parent agent uses a composite toolset like
hermes-cli(which bundles 44+ tools), callingdelegate_task(toolsets=["web"])resulted in zero tools because the intersection compared toolset names rather than the tools within them:"web" ∉ {"hermes-cli"}.Changes
tools/delegate_tool.py_expand_parent_toolsets()helper that collects all tool names from parent toolsets, then recognises any individual toolset whose tools are a subset of the parent's available toolsif toolsets:branch so individual toolset names (e.g.web,terminal,browser) are recognised when parent uses a composite likehermes-clitests/tools/test_delegate_composite_toolsets.py(new)How it works
Test results