feat(delegation): independent fallback chain for subagents - #85290
feat(delegation): independent fallback chain for subagents#85290motochan wants to merge 1 commit into
Conversation
Add delegation.fallback_providers so subagents can use a fallback chain that differs from the parent's top-level fallback_providers list. Today _build_child_agent always passes the parent's _fallback_chain, so a subagent pinned to a cheap/fast provider still fails over to the main agent's fallback models (e.g. an expensive reasoning model) instead of a subagent-appropriate backup. - config_defaults: new delegation.fallback_providers key (empty = inherit parent chain, backward compatible) - delegate_tool: _normalize_delegation_fallback_chain filters entries to the provider+model contract; _resolve_delegation_credentials forwards the chain; _build_child_agent accepts override_fallback_providers - tests: override wins, empty list inherits, malformed entries dropped Fixes NousResearch#65038
Related to #65052 and #81072: this implements the same per-child fallback-chain goal, but its |
|
Welcome, and thanks for the concrete use case — it's a good one. Heads-up for coordination: this feature already has three prior implementations, so reviewers will want the family ordered rather than re-derived:
Your PR's diff overlaps #65052 almost file-for-file, so one of them will need to absorb the other. Options, your pick: fold into #65052 as a co-authored update (your use case + tests would strengthen it), coordinate with me on a landing order, or leave both for maintainers to adjudicate. Happy to review yours either way — the |
feat(delegation): independent fallback chain for subagents
|
What does this PR do?
Adds
delegation.fallback_providersso subagents can run on a fallback chain that differs from the parent agent's top-levelfallback_providers.Today
_build_child_agentunconditionally passes the parent's_fallback_chainas the child'sfallback_model, so a subagent pinned to a cheap/fast provider still fails over to the main agent's fallback models instead of a subagent-appropriate backup.Concrete use case: main agent runs
openrouter/deepseek-v4-pro-0813withopenrouter/glm-5.2as fallback, while subagents runopenrouter/deepseek-v4-flash-0731and should fail over to a localascent-dsparkendpoint — not to the main agent's fallback chain.Related Issue
Fixes #65038
Type of Change
Changes Made
hermes_cli/config_defaults.py— newdelegation.fallback_providers: []default (empty = inherit parent chain, backward compatible)tools/delegate_tool.py—_normalize_delegation_fallback_chain()validates entries against the provider+model contract;_resolve_delegation_credentials()forwards the chain;_build_child_agent()acceptsoverride_fallback_providersand falls back to the parent chain when unset/empty; delegate tool description mentions the knobtests/tools/test_delegate.py— 3 new tests: override wins, empty list inherits parent chain, malformed entries are droppedwebsite/docs/user-guide/configuration.md+website/docs/user-guide/features/fallback-providers.md— document the new key