feat(delegation): add named subagent capability profiles - #4929
Conversation
|
Validation on this branch:
|
|
Added a small follow-up test commit on this branch. New coverage:
Validation:
|
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused tests and documentation. Current main has since established a stricter delegation boundary that this implementation crosses.
Problems
tools/delegate_tool.py:1010makesprofilemodel-facing, while the profile controls toolsets, memory access, and terminal backend overrides. The same PR also restores model-facingtoolsetsattools/delegate_tool.py:999.- Current main intentionally prevents this: delegated children receive
toolsets=Noneattools/delegate_tool.py:2492, andtests/tools/test_delegate.py:74asserts that neither top-level nor per-tasktoolsetsis exposed to the model. This was implemented byba0bc01d1f740c562b55925e404b82a48809c364specifically because capability selection must not be model-controlled.
Suggested changes
- Do not expose a profile selector that changes child capabilities through
delegate_task; preserve parent-toolset inheritance. - Any reusable policy work would need to be re-scoped as operator-controlled configuration and rebuilt against the current dispatch path.
This is an automated hermes-sweeper review.
| "full-stack tasks." | ||
| ), | ||
| }, | ||
| "profile": { |
There was a problem hiding this comment.
This makes a capability bundle model-selectable: the profile controls child toolsets, memory access, and terminal backend overrides. Current main intentionally removed model-facing child toolset selection (ba0bc01d1f740c562b55925e404b82a48809c364); please do not reintroduce capability selection through this schema.
|
Closing this PR — the core architectural objection is fundamental, and the design direction for delegation profiles is still unresolved among the maintainers. Why close: teknium1's review (Jul 12) identifies the central issue: this PR reintroduces model-facing capability selection in The suggested path forward — "re-scoped as operator-controlled configuration and rebuilt against the current dispatch path" — is a ground-up rework, not a cherry-pick. Competing approaches still unresolved:
With four PRs from different contributors all targeting the same problem and none merged, it's clear the maintainers want to settle the design direction before accepting any implementation. Re-opening a salvaged version of this PR would add a 5th entry to an unresolved design conversation rather than move it forward. What's salvageable for a future attempt:
These components could inform whatever approach the maintainers eventually settle on. |
What does this PR do?
Adds named delegation capability profiles for
delegate_task.This lets subagents inherit a policy bundle instead of only a raw toolset list. A profile can define child-safe toolsets, memory access mode, memory-provider tool exposure, and terminal backend overrides.
It also hardens child tool scoping to work on resolved tools instead of exact toolset-name intersection, which fixes dynamic/alias-style toolsets like MCP servers and avoids leaking blocked tools through umbrella toolsets.
Related Issue
Fixes #4928
Type of Change
Changes Made
restricted,friendly,privilegeddelegation.default_profileanddelegation.profilesconfig keysdelegate_task(profile=...)and per-taskprofilesupport in the schemanone,read,writecli-config.yaml.exampleHow to Test
delegation.default_profile: friendlyin~/.hermes/config.yaml.python -m pytest tests/tools/test_delegate.py tests/tools/test_delegate_toolset_scope.py tests/tools/test_parse_env_var.py -q.Validation on this branch:
68 passed7883 passed, 172 skipped, 1 xfailed, 7 failedChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A