hermes - 💡(How to fix) Fix vision_analyze returns 400 when using kimi-k2.6 with kimi-coding-cn due to incorrect _PROVIDERS_WITHOUT_VISION exclusion [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

When using kimi-coding-cn as the main provider with kimi-k2.6 model, the vision_analyze tool fails with a 400 Bad Request error on image input. This causes the vision auto-detection chain to skip the user's main provider and fallback to OpenRouter. When OpenRouter is unconfigured (or has a placeholder API key like ***), the request fails with a cryptic 400 error. 4. Falls back to OpenRouter → returns Error code: 400

Root Cause

In agent/auxiliary_client.py, kimi-coding and kimi-coding-cn are hardcoded in _PROVIDERS_WITHOUT_VISION:

_PROVIDERS_WITHOUT_VISION: frozenset = frozenset({
    "kimi-coding",
    "kimi-coding-cn",
})

This causes the vision auto-detection chain to skip the user's main provider and fallback to OpenRouter. When OpenRouter is unconfigured (or has a placeholder API key like ***), the request fails with a cryptic 400 error.

However, Kimi K2.5/K2.6 on api.moonshot.cn now natively supports vision via the standard OpenAI-compatible chat.completions endpoint with image_url content blocks. The original exclusion was based on an older assumption that vision only lived on api.moonshot.ai (see comment referencing #17076).

Fix Action

Fixed

Code Example

_PROVIDERS_WITHOUT_VISION: frozenset = frozenset({
    "kimi-coding",
    "kimi-coding-cn",
})

---

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

---

Status: 200
Response: {"id":"chatcmpl-...","model":"kimi-k2.6",...}
RAW_BUFFERClick to expand / collapse

Bug Description

When using kimi-coding-cn as the main provider with kimi-k2.6 model, the vision_analyze tool fails with a 400 Bad Request error on image input.

Root Cause

In agent/auxiliary_client.py, kimi-coding and kimi-coding-cn are hardcoded in _PROVIDERS_WITHOUT_VISION:

_PROVIDERS_WITHOUT_VISION: frozenset = frozenset({
    "kimi-coding",
    "kimi-coding-cn",
})

This causes the vision auto-detection chain to skip the user's main provider and fallback to OpenRouter. When OpenRouter is unconfigured (or has a placeholder API key like ***), the request fails with a cryptic 400 error.

However, Kimi K2.5/K2.6 on api.moonshot.cn now natively supports vision via the standard OpenAI-compatible chat.completions endpoint with image_url content blocks. The original exclusion was based on an older assumption that vision only lived on api.moonshot.ai (see comment referencing #17076).

Reproduction Steps

  1. Configure Hermes with:
    model:
      provider: kimi-coding-cn
      base_url: https://api.moonshot.cn/v1
  2. Send an image to the agent (e.g., via Feishu/Telegram/CLI)
  3. vision_analyze is called → skipped due to _PROVIDERS_WITHOUT_VISION
  4. Falls back to OpenRouter → returns Error code: 400

Verified Fix

Direct API call to https://api.moonshot.cn/v1/chat/completions with kimi-k2.6 and base64 image succeeds:

Status: 200
Response: {"id":"chatcmpl-...","model":"kimi-k2.6",...}

Proposed Fix

Remove kimi-coding and kimi-coding-cn from _PROVIDERS_WITHOUT_VISION, allowing the vision router to correctly route image analysis through the user's configured Moonshot provider.

Environment

  • Hermes Agent: latest main (commit d4b26df89)
  • Provider: kimi-coding-cn
  • Model: kimi-k2.6
  • Platform: WSL2 / Feishu gateway

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