hermes - 💡(How to fix) Fix Wrong context length for kimi-k2.6 family: OpenRouter returns 32K, overrides correct hardcoded 256K default

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…

Hermes Agent incorrectly reports kimi-k2.6 as having a 32,768 token context window, blocking agent initialization with:

ValueError: Model kimi-k2.6 has a context window of 32,768 tokens, which is below the minimum 64,000 required by Hermes Agent.

The model actually supports 256K context. The bug is in the resolution order in agent/model_metadata.py.

Root Cause

get_model_context_length() consults OpenRouter's API metadata before checking hardcoded defaults. OpenRouter incorrectly reports 32,768 for the kimi-k2.6 family. Since OpenRouter "succeeds", the correct hardcoded value of 262,144 is never reached.

Fix Action

Workaround

Add context_length: 131072 under both model: and auxiliary.compression: in config.yaml.

Code Example

"kimi-k2.6": 262144,
"kimi-k2.6-20260420": 262144,
"kimi-latest": 262144,
RAW_BUFFERClick to expand / collapse

Summary

Hermes Agent incorrectly reports kimi-k2.6 as having a 32,768 token context window, blocking agent initialization with:

ValueError: Model kimi-k2.6 has a context window of 32,768 tokens, which is below the minimum 64,000 required by Hermes Agent.

The model actually supports 256K context. The bug is in the resolution order in agent/model_metadata.py.

Root Cause

get_model_context_length() consults OpenRouter's API metadata before checking hardcoded defaults. OpenRouter incorrectly reports 32,768 for the kimi-k2.6 family. Since OpenRouter "succeeds", the correct hardcoded value of 262,144 is never reached.

Affected Models (verified via OpenRouter API)

ModelOpenRouter reportsActual
kimi-k2.632,768256K
kimi-k2.6-2026042032,768256K
kimi-latest32,768256K

Unaffected (OpenRouter correct)

  • kimi-k2.5 — reports 262,144 ✓
  • kimi-k2-thinking — reports 262,144 ✓
  • kimi-k2-0905 — reports 262,144 ✓

Proposed Fix

Add explicit entries to DEFAULT_CONTEXT_LENGTHS in agent/model_metadata.py:

"kimi-k2.6": 262144,
"kimi-k2.6-20260420": 262144,
"kimi-latest": 262144,

Workaround

Add context_length: 131072 under both model: and auxiliary.compression: in config.yaml.

Environment

  • Hermes Agent v0.13.0 (2026.5.7)
  • Provider: kimi-coding
  • Model: kimi-k2.6

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 - 💡(How to fix) Fix Wrong context length for kimi-k2.6 family: OpenRouter returns 32K, overrides correct hardcoded 256K default