Skip to content

Z.AI provider prefix not stripped from model name, causing HTTP 400 #6211

@MumuTW

Description

@MumuTW

Bug Description

When model.default is manually set with a provider prefix (e.g. zai/glm-5.1) in config.yaml, the prefix is not stripped before sending to the provider's native API, causing HTTP 400 errors.

Note: This only affects users who manually edit config.yaml. The hermes model / hermes setup CLI flow already handles prefix stripping when switching providers (auth.py:2238). This is a missing guardrail for the manual config path.

ERROR root: API call failed after 3 retries. HTTP 400: Unknown Model

Steps to Reproduce

  1. Manually set model.default: zai/glm-5.1 in ~/.hermes/config.yaml (with provider prefix)
  2. Set the corresponding API key (e.g. GLM_API_KEY)
  3. Send a message — agent fails with HTTP 400

Expected Behavior

The provider prefix should be stripped before sending the model name to native APIs. OpenRouter is the only provider that accepts provider/model format natively.

Workaround

Use bare model IDs (e.g. glm-5.1 instead of zai/glm-5.1), or select models via hermes model which handles this automatically.

Environment

  • hermes-agent v0.8.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havearea/configConfig system, migrations, profilescomp/cliCLI entry point, hermes_cli/, setup wizardprovider/zaiZAI providersweeper:implemented-on-mainSweeper: behavior already present on current maintype/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