fix(delegation): resolve child fallback chains through the full pin x config matrix (#80450) - #80479
fix(delegation): resolve child fallback chains through the full pin x config matrix (#80450)#80479ayushnangia wants to merge 3 commits into
Conversation
…n x config matrix Composes NousResearch#80465's pin semantics with NousResearch#80438/NousResearch#80421's delegation.fallback_providers semantics (NousResearch#65038) and settles the composition cell the three PRs leave undefined (NousResearch#80450 map). _resolve_child_fallback_chain implements the whole decision table in one pure function: pinned children get no chain unless the delegation section declares one (a delegation-scoped chain honors both explicit intents; the silent drag in NousResearch#80450 is specifically the PARENT chain substituting a pin); an explicit empty list disables fallback; absent config preserves historical parent inheritance exactly. Malformed declared values log and fall back PIN-AWARE — never the parent chain on a pinned child, so the config-error path cannot reintroduce the drag. Entries normalize through the canonical get_fallback_chain. The two existing inheritance tests are made hermetic against the real user config (as NousResearch#80438 also did).
Adopted from PR NousResearch#80421 with the author's explicit go-ahead on NousResearch#80450 ('Please proceed!'): config_defaults entry, cli-config.yaml.example block, and user-guide docs for the delegation-scoped fallback chain. Co-authored-by: Andrex Ibiza, MBA <84248988+andrexibiza@users.noreply.github.com>
|
Update per @andrexibiza's go-ahead on #80450: absorbed the complementary, non-overlapping parts of #80421 — the |
|
This was generated by AI during triage. Summary: Problems:
Solution: Checked against |
…ch#80450) A delegation.model-only pin (provider inherited) took the unpinned column because pinned was keyed on override_provider alone, so the child inherited the parent chain and a mid-run failure could silently swap the pinned model. model at the call site is creds["model"] -- delegation.model config -- at both call sites, so keying on it adds no false pins. base_url-only pins already resolve to a provider override. Caught by review on the PR; two matrix tests added (model-only pin with absent and declared chains).
|
Correct catch — fixed in f536c90. The pin is now keyed on |
Summary
Completes the delegation fallback-chain matrix from the #80450 cross-PR map: one pure function,
_resolve_child_fallback_chain, implementing all six cells of the pin ×delegation.fallback_providersdecision table — composing the pin semantics of #80465 (@teknium1) with the config-chain semantics of #80438 (@wz-heng) / #80421 (@andrexibiza) for #65038 (@mlahatte), and settling the composition cell that all three leave undefined.Root cause (the class)
Every open PR on this seam answers "which fallback chain does a non-head agent get?" for one input combination, editing the same
parent_fallbackhunk. The combinations interact: #80465 nulls the chain on pin, #80438/#80421 install a configured chain — land them in either order and pinned-child semantics differ silently. The matrix needs to be decided once, in one place.Changes
tools/delegate_tool.py—_resolve_child_fallback_chain(parent_agent, delegation_cfg, pinned):delegation.fallback_providers[][]Malformed declared values log and fall back pin-aware (none when pinned, parent chain otherwise) — extending #80421's log-and-inherit contract so the config-error path can't reintroduce the drag. Entries normalize through the canonical
hermes_cli.fallback_config.get_fallback_chain(ordering/dedupe identical to top-level chains). The two pre-existing inheritance tests are made hermetic against the real user config, as #80438 also did.Validation
tests/tools/test_delegate_fallback_matrix.py(14 tests): all six matrix cells, empty-parent edge, normalizer dedupe, pin-aware malformed fallback (both arms), non-dict config, plus four end-to-end wiring tests through_build_child_agentincluding pin+declared. Red on main: the suite fails collection (resolver doesn't exist); the wiring behaviors are unreachable.test_delegate.py+test_async_delegation.py+test_fallback_config.py— 88/88 viascripts/run_tests.sh.Scope notes
api_mode, fix(fallback): benched credentials must not disqualify a chain entry #79840 benched credentials) and auxiliary agents (fix(review): propagate configured curator fallback chains #79750) are separate modules with their own PRs — unaffected here.