diegosouzapw/OmniRoute · error · Error

Kimi Web model does not support context_length=

Error message

Kimi Web model does not support context_length=${requested || normalized}

What it means

Validation in resolveKimiWebContextLength: the normalized CONTEXT_LENGTH_ value is not in the model config's supportedContextLengths list. Fires when a request passes a context_length option the selected Kimi Web model does not offer; the input at fault is the request-level context_length parameter (or a stale default).

Solutions

  1. Use a context_length value listed in the model's supportedContextLengths
  2. Drop the context_length option so the model's defaultContextLength is applied
  3. Pick a Kimi Web model variant that supports the requested context length
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at open-sse/config/providers/registry/kimi/web/runtime.ts:67 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/e2746b0d689b33bd. Report an issue: GitHub.

Appendix: source

Thrown at open-sse/config/providers/registry/kimi/web/runtime.ts:67

    throw new Error(`Kimi Web model does not support reasoning_effort=${requested || normalized}`);
  }
  return normalized;
}

export function resolveKimiWebContextLength(
  value: unknown,
  config: KimiWebModelConfig
): string | undefined {
  const requested = toNonEmptyString(value);
  const normalized = requested
    ? requested.startsWith(CONTEXT_LENGTH_PREFIX)
      ? requested.toUpperCase()
      : `${CONTEXT_LENGTH_PREFIX}${requested.toUpperCase()}`
    : config.defaultContextLength;

  if (!normalized) return undefined;
  if (!config.supportedContextLengths.includes(normalized)) {
    throw new Error(`Kimi Web model does not support context_length=${requested || normalized}`);
  }
  return normalized;
}

View on GitHub (pinned to a179ffed5b)