fix(tools): pass target_model to resolve_runtime_provider in delegation (#15319)#15447
Open
Tranquil-Flow wants to merge 2 commits into
Open
fix(tools): pass target_model to resolve_runtime_provider in delegation (#15319)#15447Tranquil-Flow wants to merge 2 commits into
Tranquil-Flow wants to merge 2 commits into
Conversation
acfe927 to
8f1067e
Compare
…on (NousResearch#15319) When delegation.model differs from the parent model (e.g., delegating to claude-opus-4-6 on an opencode-zen provider while the parent uses a chat_completions model), resolve_runtime_provider needs the target model to select the correct api_mode. Without it, the delegate inherits the parent's api_mode and gets 404 errors. Supersedes NousResearch#15320.
8f1067e to
aafe9a6
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.
What does this PR do?
When
delegation.modeldiffers from the parent model (e.g., delegating toclaude-opus-4-6on anopencode-zenprovider while the parent uses achat_completionsmodel),resolve_runtime_providerneeds the target model to select the correctapi_mode. Withouttarget_model, the delegate inherits the parent'sapi_modeand gets 404 errors.The fix is a 1-line change to forward
target_modeltoresolve_runtime_provider, plus 5 test assertion updates and 1 new test case.Related Issue
Fixes #15319
Supersedes #15320.
Type of Change
Changes Made
target_modeltoresolve_runtime_providerso api_mode is selected for the delegate, not the parentTestDelegationCredentialResolutionassertions to verifytarget_modelkwarg is forwardedtest_target_model_forwarded_for_api_mode_resolutioncovering theanthropic_messagesapi_mode caseHow to Test
pytest -k TestDelegationCredentialResolution— 11/11 delegation credential tests passpytest -k test_target_model_forwarded_for_api_mode_resolution— covers theanthropic_messagesapi_mode caseChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs