hermes - 💡(How to fix) Fix feat(delegate): per-task model/provider override in delegate_task tasks array [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • Unknown provider: _resolve_delegation_credentials raises ValueError, surfaces as a clean tool error

Fix Action

Fixed

Code Example

tasks: [{
  "goal": str,
  "context": str?,
  "toolsets": [str]?,
  "model": str?,         # override model name only
  "provider": str?,      # override provider (re-resolves full creds)
  "role": "leaf" | "orchestrator"?,
  ...
}]
RAW_BUFFERClick to expand / collapse

Problem

When using delegate_task with a tasks array, all subagents run the same model/provider (delegation.model / delegation.provider in config.yaml). There is no way to route a specific subagent to a different model or provider for that one task.

Example use cases:

  • A research subagent that needs a reasoning model (deepseek-reasoner) alongside a coding subagent that needs a fast model (glm-5.1)
  • Routing web-scraping subagents to a cheap provider while keeping analysis subagents on the primary model

Proposed Schema

Add optional model and provider fields to each item in the tasks array of delegate_task:

tasks: [{
  "goal": str,
  "context": str?,
  "toolsets": [str]?,
  "model": str?,         # override model name only
  "provider": str?,      # override provider (re-resolves full creds)
  "role": "leaf" | "orchestrator"?,
  ...
}]

Semantics:

OverrideWhat happens
model onlySends a different model name to the existing delegation provider/endpoint
provider onlyRe-resolves the full credential bundle (base_url, api_key, api_mode) for that provider, uses its default model
BothRe-resolves provider creds + overrides the model name within it

Implementation sketch

In tools/delegate_tool.py:

  1. Replace the single global creds resolution (~line 1995) with per-task resolution. When t["provider"] differs from the delegation default, call _resolve_delegation_credentials() again with the overridden provider to get the full credential bundle.

  2. Feed per-task creds into _build_child_agent (~line 2061-2073). The existing override paths (override_provider, override_base_url, override_api_key, override_api_mode) already handle this — they just need the per-task values instead of a single global set.

The agent loop and AIAgent.__init__ need zero changes since _build_child_agent already resolves effective_model = model or parent_agent.model and effective_provider = override_provider or parent_agent.provider.

Edge cases

  • model without provider: only changes the model name sent to the existing endpoint — useful for swapping between models on the same provider (e.g. deepseek-chat vs deepseek-reasoner)
  • Unknown provider: _resolve_delegation_credentials raises ValueError, surfaces as a clean tool error
  • Same provider as default: no redundant re-resolution needed (compare before calling the resolver)
  • provider override auto-derives api_mode via _detect_api_mode_for_url, same as the top-level path

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix feat(delegate): per-task model/provider override in delegate_task tasks array [1 pull requests]