fix(tools): prevent credential pool from overriding delegation base_url - #8797
Closed
loktar00 wants to merge 1 commit into
Closed
fix(tools): prevent credential pool from overriding delegation base_url#8797loktar00 wants to merge 1 commit into
loktar00 wants to merge 1 commit into
Conversation
This was referenced Apr 22, 2026
Collaborator
Collaborator
|
Likely duplicate of #11456 |
Contributor
|
Thanks for identifying the credential-pool/base-URL interaction. This is an automated hermes-sweeper review; current
|
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.
What does this PR do?
When both the parent agent and delegation config resolve to provider "custom" (e.g., parent on a local vLLM endpoint, subagents on a different local endpoint),
_resolve_child_credential_poolshares the parent's credential pool with the child because the provider matches.During execution,
_run_single_childcalls_swap_credentialon the leased pool entry, which overwriteschild.base_urlwith the pool'sbase_url— the parent's endpoint. The delegationbase_urlwas correctly set duringAIAgentconstruction, then silently stomped.Fixes subagents hitting the parent's endpoint instead of their configured delegation endpoint.
tldr;
Setting my main model endpoint to
http://192.168.1.10:8080to use a model would cause the overriding of the subagent endpoints which were set athttp://192.168.1.123:8000. It tried to use the correct model, but what it would do instead was try to hithttp://192.168.1.10:8080looking for the model (which doesn't have it since these are 2 different server instances)Related Issue
No existing issue found. lol there are A LOT of issues listed but I didn't find anything related.
Type of Change
Changes Made
tools/delegate_tool.py: Added a guard in_build_child_agent()to skip credential pool sharing when the delegation config explicitly provides a differentoverride_base_urlfrom the parent's endpoint. Pool sharing is only meaningful when both agents target the same endpoint for credential rotation.How to Test
delegation.base_urlpointing to endpoint A (e.g.,http://192.168.1.123:8080/v1) with a distinct modelhttp://192.168.1.10:8080/v1)delegate_task— the subagent should hit endpoint A, not BChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/tools/test_delegate.py -qand all 67 tests passDocumentation & Housekeeping
docs/, docstrings) — N/A, no config keys or public API changedcli-config.yaml.exampleif I added/changed config keys — N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
N/A