Repository navigation
Kimi Code: a 1M context window for kimi-code legs - #93
Merged
Merged
Conversation
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
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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()setsKIMI_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
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