Skip to content

[Bug] delegate_with_model / delegate_parallel sends unresolved free-tier model aliases to OpenRouter — all calls fail 400 #28023

@CoreAspectStu

Description

@CoreAspectStu

Bug Description

delegate_with_model and delegate_parallel tools select free-tier models from the Nous Portal recommendations (e.g., nemotron-free, llama70b-free) and pass them as-is to the OpenRouter API. These are alias/shorthand names that OpenRouter does not recognize, resulting in 400 Bad Request errors on every call.

Steps to Reproduce

  1. Configure Hermes with an OpenRouter-based provider (z.ai in our case)
  2. Call delegate_with_model or delegate_parallel without specifying an explicit model
  3. Observe: tool picks mimo-v2-pro (works — real OpenRouter ID), nemotron-free (fails), llama70b-free (fails)
  4. All retries fail with: HTTP Error 400: Bad Request
  5. OpenRouter returns: {"error":{"message":"nemotron-free is not a valid model ID","code":400}}

Expected Behavior

Free-tier model aliases should be resolved to their full OpenRouter model IDs before the API call. E.g.:

  • nemotron-freenvidia/nemotron-...
  • llama70b-freemeta-llama/llama-3.3-70b-instruct or similar

Alternatively, delegate_with_model/delegate_parallel should respect the delegation.base_url and delegation.model config (e.g., route-llm via https://apps.abacus.ai), routing through the configured delegation endpoint instead of bypassing it.

Environment

  • Hermes Agent: latest (self-hosted, git clone)
  • Provider: z.ai → OpenRouter
  • Config has delegation.model: route-llm with delegation.base_url: https://apps.abacus.ai — but delegate_with_model sends to OpenRouter instead
  • delegate_task works correctly (uses delegation config → Abacus → route-llm → success)

Additional Context

  • mimo-v2-pro works because it IS a valid OpenRouter model ID (xiaomi/mimo-v2-pro)
  • ABACUS_API_KEY was not being loaded into os.environ because it was missing from _EXTRA_ENV_KEYS — this is a separate issue we patched locally. Even with the key loaded, the model resolution bug persists.
  • The fallback_providers chain in config.yaml is correctly configured but is not consulted by delegate_with_model.

Workaround

Use delegate_task instead, which correctly routes through the delegation.* config to Abacus route-llm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/openrouterOpenRouter aggregatortool/delegateSubagent delegationtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions