You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add named delegation.profiles config for reusable subagent routing lanes
let delegate_task accept a top-level profile and per-task batch profile
merge profile config over root delegation config before resolving child credentials/toolsets
validate unknown or malformed profiles before spawning any child agents
keep max_iterations config/profile-authoritative and out of the model schema
Why
Advanced users often want different subagent lanes for discovery, coding, review, and research. Today that requires repeating provider/model/reasoning/toolset settings every time, or hardcoding local behavior. Named profiles make the existing delegate_task tool configurable without adding another core tool.
Default behavior is unchanged when delegation.profiles is empty or no profile is passed.
Tests
python -m pytest tests/tools/test_delegate.py -q -k 'profile or schema_valid or runtime_limits or schema_overrides'
Notes:
Full tests/tools/test_delegate.py currently hits an unrelated timing-flaky heartbeat assertion on upstream/main as well. I confirmed the same failure on a clean upstream/main worktree; the profile-specific tests pass.
Verified the delegation profile implementation — clean and well-structured. Specific checks applied:
Profile merge semantics (_merge_delegation_profile): None values in a profile are correctly treated as "don't override" (skip), while non-None values (including empty strings) override the base config. This allows profiles to intentionally clear inherited values.
Fail-fast validation: Unknown profile names raise ValueError before any child agent is constructed. The error message lists known profiles, which is a nice UX touch. No zombie children left behind on validation failure.
Per-task credential resolution: _resolve_delegation_credentials is now called per-task with the profile-merged config (task_cfg), not once globally. This is correct — different profiles may specify different providers/models requiring different credentials.
Backward compatibility: _build_child_agent's new delegation_cfg parameter defaults to None and falls back to _load_config() when unset. Direct callers (tests, internal code paths) that don't pass it continue to work unchanged.
Type guard on parent_enabled: The added isinstance(parent_enabled_raw, (list, tuple, set, frozenset)) check is a defensive improvement over the bare truthiness check — prevents a non-collection truthy value (e.g., a string) from silently passing through.
Service tier handling: _parse_service_tier_config maps "fast"/"priority"/"on" → "priority" and ignores unknown values with a warning. The resolve_fast_mode_overrides import is wrapped in a broad except Exception for forward-compatibility. Clean.
Good test coverage across single-task profile, batch multi-profile, and unknown-profile error paths.
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
comp/cliCLI entry point, hermes_cli/, setup wizardduplicateThis issue or pull request already existsP3Low — cosmetic, nice to havetool/delegateSubagent delegationtype/featureNew feature or request
3 participants
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
delegation.profilesconfig for reusable subagent routing lanesdelegate_taskaccept a top-levelprofileand per-task batchprofilemax_iterationsconfig/profile-authoritative and out of the model schemaWhy
Advanced users often want different subagent lanes for discovery, coding, review, and research. Today that requires repeating provider/model/reasoning/toolset settings every time, or hardcoding local behavior. Named profiles make the existing
delegate_tasktool configurable without adding another core tool.Default behavior is unchanged when
delegation.profilesis empty or noprofileis passed.Tests
python -m pytest tests/tools/test_delegate.py -q -k 'profile or schema_valid or runtime_limits or schema_overrides'Notes:
tests/tools/test_delegate.pycurrently hits an unrelated timing-flaky heartbeat assertion onupstream/mainas well. I confirmed the same failure on a cleanupstream/mainworktree; the profile-specific tests pass.