Skip to content

fix(delegation): honor pinned delegation.provider — no silent parent-fallback substitution - #80465

Merged
teknium1 merged 1 commit into
mainfrom
fix/delegation-pin-no-parent-fallback
Aug 17, 2026
Merged

fix(delegation): honor pinned delegation.provider — no silent parent-fallback substitution#80465
teknium1 merged 1 commit into
mainfrom
fix/delegation-pin-no-parent-fallback

Conversation

@teknium1

@teknium1 teknium1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

An explicitly pinned delegation.provider/delegation.model is now honored for the child's whole run — a mid-run failure on the pin fails loudly instead of silently rerouting the quiet-mode child onto the parent's fallback models.

Root cause: _build_child_agent inherited parent._fallback_chain unconditionally (delegate_tool.py:1469→1524), so try_activate_fallback could swap the pinned child's model/provider at runtime with no surfaced signal. The sibling override_provider guard already cleared parent OpenRouter routing filters for exactly this reason — the fallback chain never got the same treatment.

Changes

  • tools/delegate_tool.py: parent_fallback = None when override_provider is set (pin honored or loud failure); pinned delegation.command missing from PATH now raises at credential preflight AND in _build_child_agent (was: logger.warning + silent transport fallback); delegate_task catches the build-time ValueError and returns tool_error.
  • tests/tools/test_delegate.py: 3 regression tests (pin disables chain inheritance, missing pinned command raises in build, missing pinned command rejected at preflight).

Validation

Before After
Pinned provider, mid-run 401/429 child silently hops to parent fallback models fails loudly, pin respected
Unpinned delegation inherits parent fallback chain unchanged
Pinned delegation.command not on PATH warning + silent default transport spawn refused with clear message
tests/tools/test_delegate.py 63 passed 66 passed

Fixes #80450. Tracker #79686 audit item ("no-silent-fallback model pinning in delegate_task").

Infographic

Pinned delegation provider: honored or loud failure

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint tool/delegate Subagent delegation area/config Config system, migrations, profiles sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 6, 2026
@spfcraze

spfcraze commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Summary:
The fallback-chain gate keys on override_provider alone, so a model-only delegation pin still inherits the parent's fallback chain and can be silently swapped mid-run — the case #80450's proposed fix explicitly names alongside override_provider.

Problems:

  • tools/delegate_tool.py:3783 — the if not configured_provider: branch returns "provider": None while carrying the configured model, so delegate_task passes override_provider=None and the new parent_fallback = None if override_provider else ... gate keeps parent._fallback_chain for a model-only pin (the configuration.md:2282-documented "Setting just model without provider" combination).
  • try_activate_fallback (agent/chat_completion_helpers.py:1730) then swaps the child's model/provider in-place on mid-run auth/429/5xx — the pinned model is silently replaced, the runtime substitution delegate_task: pinned delegation.provider/model silently replaced at runtime by inherited parent fallback chain #80450 describes ("the pin is NOT honored after spawn").

Solution:
Pass fallback_model=None when an explicit delegation.model pin is set, per #80450's own proposed fix — thread a "model explicitly configured" flag from _resolve_delegation_credentials into the parent_fallback decision so the gate covers the model-only case the way it covers provider pins.


Checked against ee6b581 — the tip of fix/delegation-pin-no-parent-fallback when this was written — and 9d4ef04, main at the same moment.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

૮ >ﻌ< ა ci review

ran on 5516ebe — fix(delegation): honor pinned delegation.provider — no silen

⚠️ Warnings

CI timings · View report · View job

Wall time 21m21s vs 8m (+166.9%). 14 job(s) slower, 9 faster, 1 unchanged.

  • Python tests / Run tests slice 7/12: -55.0s
  • Python tests / Run tests slice 4/12: -35.0s
  • Python tests / Run tests slice 1/12: +31.0s
  • Python tests / Run tests slice 3/12: -22.0s
  • Python tests / Run tests slice 5/12: -19.0s

OSV vulnerability scan · View job

5 known vulnerabilities found in pinned dependencies.

How to fix:

Review the findings in the Security tab. Update the affected dependencies if a patched version is available.

…fallback substitution

When delegation.provider/model is explicitly pinned, the child no longer
inherits the parent's fallback chain: a mid-run auth/429 failure on the
pin previously rerouted the quiet-mode child onto parent fallback models
with no surfaced signal. Same treatment as the existing override_provider
OpenRouter filter-clearing — explicit pins are honored or fail loudly.

Also upgrades the pinned delegation.command-missing-from-PATH case from
warning + silent transport fallback to a loud spawn refusal, both at
credential preflight and in _build_child_agent.

Fixes #80450 (tracker #79686 audit item).
@teknium1
teknium1 force-pushed the fix/delegation-pin-no-parent-fallback branch from ee6b581 to 5516ebe Compare August 17, 2026 02:54
@teknium1
teknium1 merged commit 184cddb into main Aug 17, 2026
45 checks passed
@teknium1
teknium1 deleted the fix/delegation-pin-no-parent-fallback branch August 17, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

delegate_task: pinned delegation.provider/model silently replaced at runtime by inherited parent fallback chain

3 participants