hermes - ✅(Solved) Fix [Bug]: OpenRouter Model ID passed to provider-specific API endpoint causing 404 [1 pull requests, 1 participants]

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…
GitHub stats
NousResearch/hermes-agent#14309Fetched 2026-04-23 07:45:40
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4cross-referenced ×1

Error Message

⚠️  API call failed (attempt 1/3): NotFoundError [HTTP 404]
   🔌 Provider: kimi-coding-cn  Model: k2p6
   🌐 Endpoint: https://api.moonshot.cn/v1
   📝 Error: HTTP 404: Not found the model k2p6 or Permission denied

Root Cause

The reverse is also problematic: if a Moonshot-native model ID is used with provider: openrouter, OpenRouter returns 404 because it doesn't know that model name format.

Fix Action

Fixed

PR fix notes

PR #14322: fix: normalize kimi short aliases before provider routing

Description (problem / solution / changelog)

Summary

  • expand Kimi short aliases like k2p6 into canonical kimi-k2.x model IDs before provider-specific normalization runs
  • let native Kimi providers receive the Moonshot-native model slug, while aggregators like OpenRouter still get the vendor-prefixed form
  • add regression coverage so unrelated providers keep unknown short aliases untouched

Fixes #14309

Testing

  • python3 -m pytest -o addopts='' tests/hermes_cli/test_model_normalize.py

Changed files

  • hermes_cli/model_normalize.py (modified, +25/-1)
  • tests/hermes_cli/test_model_normalize.py (modified, +14/-0)

Code Example

⚠️  API call failed (attempt 1/3): NotFoundError [HTTP 404]
   🔌 Provider: kimi-coding-cn  Model: k2p6
   🌐 Endpoint: https://api.moonshot.cn/v1
   📝 Error: HTTP 404: Not found the model k2p6 or Permission denied

---

model:
     default: k2p6
     provider: kimi-coding-cn
     base_url: https://api.moonshot.cn/v1

---

⚠️  API call failed (attempt 1/3): NotFoundError [HTTP 404]
   🔌 Provider: kimi-coding-cn  Model: k2p6
   🌐 Endpoint: https://api.moonshot.cn/v1
   📝 Error: HTTP 404: Not found the model k2p6 or Permission denied

---

⚠️  This will upload the following to a public paste service:
System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report     https://paste.rs/gVCG2
  agent.log  https://dpaste.com/D8VFFE8JM

Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Share these links with the Hermes team for support.

---



---

model:
     default: k2p6
     provider: kimi-coding-cn
     base_url: https://api.moonshot.cn/v1
RAW_BUFFERClick to expand / collapse

Bug Description

When a profile is configured with provider: kimi-coding-cn (Moonshot China API) but uses an OpenRouter-style model ID like k2p6, the agent sends the request to Moonshot's endpoint (https://api.moonshot.cn/v1) with the OpenRouter model ID, which Moonshot does not recognize, resulting in HTTP 404.

The reverse is also problematic: if a Moonshot-native model ID is used with provider: openrouter, OpenRouter returns 404 because it doesn't know that model name format.

Error Message

⚠️  API call failed (attempt 1/3): NotFoundError [HTTP 404]
   🔌 Provider: kimi-coding-cn  Model: k2p6
   🌐 Endpoint: https://api.moonshot.cn/v1
   📝 Error: HTTP 404: Not found the model k2p6 or Permission denied

Affected Scenarios

  1. User configures an OpenRouter model (e.g., k2p6) with provider: kimi-coding-cn → 404 from Moonshot
  2. User configures a Moonshot model (e.g., kimi-k2.6) with provider: openrouter → 404 from OpenRouter
  3. Delegated subagent profile has wrong model ID format for its assigned provider (as in this case)

Steps to Reproduce

  1. Create a subagent profile (~/.hermes/profiles/<profile>/config.yaml) with:
    model:
      default: k2p6
      provider: kimi-coding-cn
      base_url: https://api.moonshot.cn/v1
  2. Start the subagent and send any message
  3. Observe 404 error from Moonshot API

Expected Behavior

The agent should either:

  • Option A (Recommended): Validate model IDs against the provider's known model list at startup or when the model is first used, and emit a clear error message if mismatched (e.g., "Model 'k2p6' is not available on provider 'kimi-coding-cn'. Did you mean to use provider 'openrouter'?")

  • Option B: Provide an auto-translation layer where the user can specify an OpenRouter model ID and the agent routes it to the correct provider endpoint (OpenRouter API handles translation internally)

  • Option C: At minimum, document the naming requirement clearly and warn in the error message that the model ID may be for a different provider

Actual Behavior

⚠️  API call failed (attempt 1/3): NotFoundError [HTTP 404]
   🔌 Provider: kimi-coding-cn  Model: k2p6
   🌐 Endpoint: https://api.moonshot.cn/v1
   📝 Error: HTTP 404: Not found the model k2p6 or Permission denied

Affected Component

Configuration (config.yaml, .env, hermes setup)

Messaging Platform (if gateway-related)

No response

Debug Report

⚠️  This will upload the following to a public paste service:
  • System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
  • Recent log lines (agent.log, errors.log, gateway.log — may contain
    conversation fragments and file paths)
  • Full agent.log and gateway.log (up to 512 KB each — likely contains
    conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report     https://paste.rs/gVCG2
  agent.log  https://dpaste.com/D8VFFE8JM

⏱  Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Share these links with the Hermes team for support.

Operating System

Ubuntu-22.04

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The agent does not validate or translate model IDs when the user configures a model ID that belongs to a different provider's naming scheme. The model ID is passed through verbatim to the API endpoint.

OpenRouter model ID examples: k2p6, anthropic/claude-sonnet-4, google/gemini-2.5-flash Moonshot model ID examples: kimi-k2.6, moonshot-v1-8k-vision-preview MiniMax model ID examples: MiniMax-Text-01, MiniMax-VL-01

These naming schemes are provider-specific and are not interchangeable.

Affected Scenarios

  1. User configures an OpenRouter model (e.g., k2p6) with provider: kimi-coding-cn → 404 from Moonshot
  2. User configures a Moonshot model (e.g., kimi-k2.6) with provider: openrouter → 404 from OpenRouter
  3. Delegated subagent profile has wrong model ID format for its assigned provider (as in this case)

Steps to Reproduce

  1. Create a subagent profile (~/.hermes/profiles/<profile>/config.yaml) with:
    model:
      default: k2p6
      provider: kimi-coding-cn
      base_url: https://api.moonshot.cn/v1
  2. Start the subagent and send any message
  3. Observe 404 error from Moonshot API

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

To fix the issue, validate model IDs against the provider's known model list at startup or when the model is first used, and emit a clear error message if mismatched.

Guidance

  • Check the provider field in the configuration file (config.yaml) to ensure it matches the model ID's naming scheme.
  • Validate model IDs against the provider's known model list to prevent incorrect requests.
  • Consider implementing an auto-translation layer to route model IDs to the correct provider endpoint.
  • Clearly document the naming requirements for each provider to avoid user confusion.

Example

model:
  default: k2p6
  provider: openrouter
  base_url: https://api.openrouter.com/v1

In this example, the provider field is set to openrouter, which matches the naming scheme of the model ID k2p6.

Notes

The proposed fix requires changes to the configuration validation and error handling logic. The auto-translation layer is an optional feature that can be implemented to improve user experience.

Recommendation

Apply a workaround by validating model IDs against the provider's known model list and emitting a clear error message if mismatched, as this is a more straightforward solution that can be implemented quickly.

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 - ✅(Solved) Fix [Bug]: OpenRouter Model ID passed to provider-specific API endpoint causing 404 [1 pull requests, 1 participants]