feat(tools): add per-call delegation provider routing#28940
Open
Tranquil-Flow wants to merge 2 commits into
Open
feat(tools): add per-call delegation provider routing#28940Tranquil-Flow wants to merge 2 commits into
Tranquil-Flow wants to merge 2 commits into
Conversation
Collaborator
8bca7e4 to
f12cc23
Compare
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
Adds per-call and per-task
provider/modeloverrides todelegate_task, so a parent agent can route delegated subagents to different runtime providers/models without changing global config.This extends the existing delegation credential resolution path rather than introducing a separate provider allowlist. It keeps the existing direct-endpoint behavior for
delegation.base_urlwhen no explicit provider override is supplied, while letting an explicit per-call/per-task provider override route through the runtime provider resolver.Why
Delegation currently supports configuring default delegation credentials, but the tool call itself cannot cleanly say “run this child with provider X/model Y” or mix routing inside one batch. That makes delegation less useful for common agent workflows such as:
tasks=[...]fan-out,acp_commandis explicitly requested.What changed
providerandmodelfields to thedelegate_taskschema and registry dispatch.providerandmodelfields for batch mode.delegation.base_urldirect-endpoint behavior when no explicit provider override is supplied.delegation.base_urland use the runtime provider resolver.acp_commandprecedence: when ACP is explicitly requested, ACP transport wins over provider/model routing.Honest comparison with related PRs
This overlaps with existing open attempts to solve the same general feature gap, especially:
This PR is not claiming the feature idea is unique. The potential value of this branch is that it is based on current
main, keeps the diff focused totools/delegate_tool.pyandtests/tools/test_delegate.py, and adds a relatively broad regression suite around the behavior boundaries that seemed easiest to regress:delegation.base_urlpreservation vs explicit provider override,If maintainers prefer one of the existing PRs, this branch may still be useful as a test/semantics reference rather than a competing implementation.
Related issue
Related to #3719.
I am intentionally using “Related to” rather than “Fixes” because the issue is already closed and there are multiple overlapping open PRs.
How to test
Focused checks run locally:
./.venv/bin/python -m ruff check tools/delegate_tool.py tests/tools/test_delegate.py ./.venv/bin/python -m pytest tests/tools/test_delegate.py -q -o 'addopts=' --tb=short ./.venv/bin/python scripts/check-windows-footguns.py --diff upstream/main...HEADResults:
tests/tools/test_delegate.py: 152 passedAdditional broader checks run before the final commit-message-only amend:
Notes:
tests/toolsrun was killed by the constrained container with exit 137 at partial progress; rerunning pytest’s last-failed set from that aborted run passed. I am not claiming a full-suite pass.Platforms tested
The code path is Python-only and does not add shell commands, OS-specific process management, or new dependencies.