Skip to content

Kimi Code: a 1M context window for kimi-code legs - #93

Merged
Thykof merged 1 commit into
mainfrom
feat/kimi-context-1m
Nov 9, 2026
Merged

Thykof merged 1 commit into
mainfrom
feat/kimi-context-1m

Conversation

@Thykof

@Thykof Thykof commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Why

kimi-code compacts its history against the model's context window. For a model it gets from the KIMI_MODEL_* env vars, which is how the harness routes it through the proxy, it assumes 262,144 tokens. Kimi K3.1 Pro serves 1,048,576, so a kimi-code leg compacted at a quarter of the model's window.

What

KimiCodeAdapter.env() sets KIMI_MODEL_MAX_CONTEXT_SIZE=1048576, Kimi K3.1 Pro's window. It applies to every kimi-code leg; a leg on a model with a smaller window would need its own value.

Tests

  • The adapter test checks the variable.
  • uv run pytest -q tests/benchmark/test_cli_adapters.py: 12 passed. black 26.5.1 and flake8 clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh

kimi-code compacts against 262144 tokens for a model defined by env vars.
KIMI_MODEL_MAX_CONTEXT_SIZE=1048576 gives it Kimi K3.1 Pro's window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@Thykof
Thykof merged commit ca0c760 into main Nov 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant