Skip to content

fix(delegation): pass target_model to resolve_runtime_provider in _resolve_delegation_credentials#19623

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(delegation): pass target_model to resolve_runtime_provider in _resolve_delegation_credentials#19623
teknium1 merged 1 commit into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1

@teknium1 teknium1 commented May 4, 2026

Copy link
Copy Markdown
Contributor

Salvage of #15320 onto current main.\n\n## Summary\nWhen differs from on providers like opencode-go or opencode-zen, delegate_task fails with 404. calls without a , so api_mode is computed from the MAIN model instead of the delegation model. Pass so api_mode reflects the delegation target.\n\n## Validation\nManual review; diff scope self-contained.\n\nOriginal PR: #15320

…solve_delegation_credentials

When delegation.model differs from model.default and the provider is
opencode-go or opencode-zen, the wrong api_mode is computed because
resolve_runtime_provider falls back to model_cfg.get('default') — the
main model — instead of the configured delegation model.

For example, with model.default=minimax-m2.7 (anthropic_messages) and
delegation.model=glm-5.1 (chat_completions), subagents get
anthropic_messages, which strips /v1 from the base URL and causes a 404.

resolve_runtime_provider already accepts target_model for exactly this
purpose; _resolve_delegation_credentials just wasn't passing it.

Fixes #15319
Related: #13678
@teknium1 teknium1 merged commit 83bbe9b into main May 4, 2026
9 of 10 checks passed
@teknium1 teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 09:30
@alt-glitch alt-glitch added type/bug Something isn't working tool/delegate Subagent delegation P2 Medium — degraded but workaround exists labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Medium — degraded but workaround exists tool/delegate Subagent delegation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants