feat: add native delegation profiles - #41998
Open
martynovdenis312 wants to merge 7 commits into
Open
Conversation
martynovdenis312
force-pushed
the
feat/delegation-profiles-20260608-124016
branch
from
June 8, 2026 10:02
92ee508 to
fc39953
Compare
Contributor
|
Verified — delegation profiles PR with focus on credential isolation and toolset cap enforcement. Checked:
No issues found. Clean security model. |
Keep the public delegate_task positional parent_agent slot stable while adding delegation_profile support, and cover the agent-loop dispatch path that bypasses the registry handler.\n\nTested: python -m pytest tests/tools/test_delegate.py tests/tools/test_delegate_config_reload.py -v -k 'DispatchDelegateTask or DelegationProfileConfig or DelegationProviderIntegration or config_reload or Profile'\nTested: python -m pytest tests/tools/test_delegate.py tests/tools/test_delegate_config_reload.py tests/tools/test_delegate_toolset_scope.py tests/tools/test_delegate_composite_toolsets.py tests/tools/test_delegate_subagent_timeout_diagnostic.py -q\nTested: python -m compileall -q run_agent.py tools/delegate_tool.py tests/tools/test_delegate.py tests/tools/test_delegate_config_reload.py hermes_cli/config.py\nTested: python -m ruff check run_agent.py tools/delegate_tool.py tests/tools/test_delegate.py tests/tools/test_delegate_config_reload.py hermes_cli/config.py\nTested: git diff --check
martynovdenis312
force-pushed
the
feat/delegation-profiles-20260608-124016
branch
from
June 10, 2026 12:20
520bb96 to
2b89947
Compare
Keep subdirectory hint discovery anchored to the logical workspace path so project AGENTS.md files are loaded when users access symlinked project directories from inside the active working tree. Normalize parent traversal without resolving symlink targets, and keep direct outside paths rejected. Tested: python -m pytest tests/agent/test_subdirectory_hints.py tests/agent/test_prompt_builder.py tests/agent/test_system_prompt.py -q -o 'addopts=' Tested: python -m py_compile agent/subdirectory_hints.py && git diff --check
Contributor
|
Thanks for the substantial implementation and tests. There is one current-main design conflict and a scope issue. Problems
Suggested changes
This is an automated hermes-sweeper review. |
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
Refreshes PR #41998 onto current
mainand keeps the branch clean for the existing native delegation profiles proposal.Adds first-class delegation profiles under
delegation.profilessodelegate_taskcan route child agents to a named provider/model/tool policy without shell wrappers or separate spawned Hermes processes.Key behavior:
delegation_profilesupport.delegationconfig.toolsetsdefaults andallowed_toolsetshard caps per profile.delegate_task(..., parent_agent)positional compatibility while addingdelegation_profile.file_readonlyas a read-only subagent toolset option and documents the difference from writablefile.Also preserves the existing Qwen local-relay session identity fixes already on this PR branch:
Tests
uv run --frozen --with pytest --with pytest-timeout python -m pytest tests/tools/test_delegate.py tests/tools/test_delegate_config_reload.py tests/agent/test_qwen_session_state.py tests/test_toolsets.py -qpython3 -m compileall -q agent tools hermes_cli run_agent.py toolsets.pyuv run --frozen ruff check agent/chat_completion_helpers.py agent/conversation_loop.py agent/qwen_session_state.py agent/transports/chat_completions.py hermes_cli/config.py run_agent.py tools/delegate_tool.py toolsets.py tests/agent/test_qwen_session_state.py tests/test_toolsets.py tests/tools/test_delegate.py tests/tools/test_delegate_config_reload.pygit diff --check origin/main...HEAD.omx/ultragoalfiles in the submitted diffReview
Local review passes found and fixed issues before this refresh:
run_agent.AIAgent._dispatch_delegate_task()initially did not forward top-leveldelegation_profile; fixed and covered by regression test.delegate_tasksignature initially inserteddelegation_profilebeforeparent_agent; fixed by keepingparent_agentin its previous positional slot and adding a back-compat regression test.fileas read-only; fixed to documentfile_readonlyseparately.Latest independent pre-push review: APPROVE, 8/10, no blockers.
Notes / residual risks
delegation.profiles.<name>.allowed_toolsetsis intentionally fail-closed and exact-name based after known composite expansion.toolsetsleak into each task; use per-task toolsets or profile defaults.