From ecbb3c69287a8ae02d710665d98d3a1949cae6df Mon Sep 17 00:00:00 2001 From: Thykof Date: Mon, 9 Nov 2026 12:14:33 +0100 Subject: [PATCH] Kimi Code: a 1M context window for kimi-code legs 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 Claude-Session: https://claude.ai/code/session_016kmUsyYSEMPGiwbSuvR9hh --- synth_lib/benchmark/cli_adapters.py | 3 +++ tests/benchmark/test_cli_adapters.py | 1 + 2 files changed, 4 insertions(+) diff --git a/synth_lib/benchmark/cli_adapters.py b/synth_lib/benchmark/cli_adapters.py index 7277005..9329fe5 100644 --- a/synth_lib/benchmark/cli_adapters.py +++ b/synth_lib/benchmark/cli_adapters.py @@ -235,6 +235,9 @@ def env(self) -> dict[str, str]: # Each sandbox run has a new hostname, so a session lock left by a killed run counts as held # and `-c` exits 4. A leg runs one kimi process at a time. "KIMI_CODE_SESSION_LOCK": "0", + # The window kimi-code compacts against; it assumes 262144 for an env-defined model. + # 1048576 is Kimi K3.1 Pro's. + "KIMI_MODEL_MAX_CONTEXT_SIZE": "1048576", } def provision_files(self) -> dict[str, str]: diff --git a/tests/benchmark/test_cli_adapters.py b/tests/benchmark/test_cli_adapters.py index 87b4906..340159d 100644 --- a/tests/benchmark/test_cli_adapters.py +++ b/tests/benchmark/test_cli_adapters.py @@ -140,6 +140,7 @@ def test_kimi_adapter_routes_through_the_proxy_env_family(): # a CLI that self-updates mid-campaign changes the subject of the experiment assert env["KIMI_CODE_NO_AUTO_UPDATE"] == "1" assert env["KIMI_CODE_SESSION_LOCK"] == "0" # a lock left by a killed sandbox run would block -c + assert env["KIMI_MODEL_MAX_CONTEXT_SIZE"] == "1048576" assert a.provision_files() == {} # no effort: the CLI's own resume = a.resume_cmd("continue") assert resume[:2] == ["kimi", "-c"]