Skip to content

fix(delegate): pass per-task model override and explicit credentials to runtime provider#32555

Open
tcsenpai wants to merge 1 commit into
NousResearch:mainfrom
tcsenpai:fix/delegate-model-override
Open

fix(delegate): pass per-task model override and explicit credentials to runtime provider#32555
tcsenpai wants to merge 1 commit into
NousResearch:mainfrom
tcsenpai:fix/delegate-model-override

Conversation

@tcsenpai

Copy link
Copy Markdown

Summary

Two fixes in delegate_task() that cause delegation failures with non-default providers:

Fix 1: Per-task model override ignored (L2066)

- model=creds["model"],
+ model=t.get("model") or creds["model"],

When using delegate_task with batch tasks that specify different models per task, the model field was completely ignored — all subagents got the provider default.

Fix 2: Custom provider credentials not forwarded (L2432)

- runtime = resolve_runtime_provider(requested=configured_provider, target_model=configured_model)
+ runtime = resolve_runtime_provider(
+     requested=configured_provider,
+     target_model=configured_model,
+     explicit_api_key=configured_api_key,
+     explicit_base_url=configured_base_url,
+ )

_resolve_delegation_credentials resolves configured_api_key and configured_base_url from config, but never passes them to resolve_runtime_provider. Custom/named providers that need explicit credentials (API key + base URL) fail to resolve correctly.

…to runtime provider

Two fixes in delegate_task():
- Use t.get('model') or creds['model'] so per-task model overrides are
  respected when delegating batch subagents (previously ignored)
- Forward explicit_api_key and explicit_base_url to resolve_runtime_provider
  so custom/named providers resolve credentials correctly

Both bugs cause delegation failures when using non-default providers.
@alt-glitch alt-glitch added type/bug Something isn't working comp/tools Tool registry, model_tools, toolsets tool/delegate Subagent delegation P2 Medium — degraded but workaround exists labels May 26, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with several open PRs for the same per-task model override fix: #17718, #23649, #20000, #6771 (and feature PRs #28940, #16163). The bug (Fix 1) is tracked in #17685 (dup of #11999) and the feature request umbrella is #14974. Fix 2 (credential forwarding) is related to #26722.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets 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.

2 participants