Bugfix: preserve delegation api_mode for custom endpoints#10273
Closed
HiddenPuppy wants to merge 3 commits into
Closed
Bugfix: preserve delegation api_mode for custom endpoints#10273HiddenPuppy wants to merge 3 commits into
HiddenPuppy wants to merge 3 commits into
Conversation
5ef410c to
03b4b65
Compare
9 tasks
Contributor
|
Thanks @HiddenPuppy! Salvaged into PR #26824 — merged as c445f48. Your authorship is preserved via the Co-Authored-By trailer on the merge commit. Your branch was stale enough that a direct cherry-pick would have brought in unrelated workflow/plugin-test changes already landed on main, so I reimplemented the substantive fix in delegate_tool.py against current main and used _detect_api_mode_for_url() (the shared helper the main agent's runtime resolver already uses) instead of determine_api_mode for consistency. The behavioral outcome matches your fix. Closing this in favor of #26824. |
1 task
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
This fixes delegation provider resolution for direct custom endpoints so subagents keep the correct wire protocol when
delegation.base_urlis configured.Fixes #10213.
Root Cause
tools.delegate_tool._resolve_delegation_credentials()ignoreddelegation.api_modefor direct endpoints and used a narrower URL heuristic than the main provider runtime. Anthropic-compatible endpoints like Microsoft Foundry could therefore be misclassified aschat_completions, which sent subagent requests to the wrong path.What Changed
delegation.api_modefor direct endpointsValidation
python -m pytest tests/tools/test_delegate.py -k "direct_endpoint_respects_explicit_api_mode or direct_endpoint_auto_detects_anthropic_suffix or direct_anthropic_endpoint_reaches_child_agent_with_anthropic_api_mode or direct_endpoint_credentials_reach_child_agent" -qpython -m pytest tests/tools/test_delegate.py -k "TestDelegationCredentialResolution or TestDelegationProviderIntegration" -q