Skip to content

[BUG] Model switching fails when using Alibaba Coding Plan custom provider - auto-resolution ignores user config #14940

@SugarMask

Description

@SugarMask

Problem Description

Model switching fails when using Alibaba Cloud Dashscope Coding Plan models. The default model works perfectly, but switching to any other model via /model <model-name> results in authentication errors (401) or fallback to incorrect providers (OpenRouter).

Hermes Agent Version

Latest version as of April 24, 2026

Operating System

Windows with WSL2 (Ubuntu)

Steps to Reproduce

  1. Configure config.yaml with an Alibaba Coding Plan model as default:
model:
  default: kimi-k2.5
  provider: alibaba_coding
  api_key: sk-sp-***(your actual API key)
  1. The default model works correctly
  2. Attempt to switch to another model: /model MiniMax-M2.5
  3. Error occurs - Hermes auto-resolves to alibaba-coding-plan provider but fails

Expected Behavior

Switching models should use the same provider configuration as the default model, or respect the user-defined provider settings in config.yaml.

Actual Behavior

Hermes ignores the provider field in config.yaml for models and uses auto-resolution from models_dev_cache.json, which causes authentication failures.

Additional Relevant Information

.env configuration:

ALIBABA_CODING_PLAN_API_KEY=sk-sp-***(your actual API key)

Providers in models_dev_cache.json:

  • alibaba - endpoint: dashscope-intl.aliyuncs.com/compatible-mode/v1 (standard)
  • alibaba-coding-plan - endpoint: coding-intl.dashscope.aliyuncs.com/v1 (coding plan)

Model distribution:

  • Models like kimi-k2.5, MiniMax-M2.5, glm-5 are in alibaba-coding-plan
  • Model qwen3-coder-plus is in alibaba (standard)

Observed Errors

⚠️ API call failed (attempt 1/3): AuthenticationError [HTTP 401]
🔌 Provider: custom  Model: kimi-k2.5
🌐 Endpoint: https://coding-intl.dashscope.aliyuncs.com/v1
📝 Error: HTTP 401: invalid access token or token expired

When using provider: alibaba-coding-plan:

⚠️ API call failed: HTTP 402
🔌 Provider: custom  Model: kimi-k2.5
🌐 Endpoint: https://openrouter.ai/api/v1

Configurations Attempted (all failed)

  1. provider: alibaba_coding - default works, switching fails
  2. provider: alibaba-coding-plan - Hermes ignores and falls back to OpenRouter
  3. provider: custom with base_url - endpoint correct but API key rejected
  4. Using aliases with leo- prefix - "model not supported"
  5. Modifying models_dev_cache.json - no effect

Hypothesis

Hermes has a provider auto-resolution system (step 4 in the precedence order) that overrides user configuration. When switching models, Hermes:

  1. Looks up the model in models_dev_cache.json
  2. Finds the model belongs to alibaba-coding-plan
  3. Ignores user-defined provider in config.yaml
  4. Uses wrong provider or fails to read environment variables correctly

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existsarea/configConfig system, migrations, profilescomp/agentCore agent loop, run_agent.py, prompt buildertype/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