Skip to content

The agent that grows with you

fix(compression): -900k Codex variants keep the global 50% threshold; 85% autoraise stays on 272K base slugs

Teknium933c209e9663
diff --git a/agent/auxiliary_client.py b/agent/auxiliary_client.py
index 8d387b86d1e..b824a89b3f5 100644
--- a/agent/auxiliary_client.py
+++ b/agent/auxiliary_client.py
@@ -678,11 +678,19 @@ def _is_codex_gpt54_or_gpt55(model: Optional[str], provider: Optional[str] = Non
``compression.codex_gpt55_autoraise`` config key.) The exact
``gpt-daybreak-blue-latest`` Codex slug is also a verified Sol-family
alias and receives the same autoraise.
+
+ ``-900k`` large-context picker variants are explicitly EXCLUDED: the
+ 85% autoraise exists to stop wasting a small 272K window, and a 900K
+ window doesn't have that problem — those sessions keep the user's
+ global ``compression.threshold`` (default 50%, ~450K).
"""
prov = (provider or "").strip().lower()
if prov != "openai-codex":
return False
bare = (model or "").strip().lower().rsplit("/", 1)[-1]
+ from agent.model_metadata import is_codex_context_variant
+ if is_codex_context_variant(bare):
+ return False
return (
bare == "gpt-5.4"
or bare.startswith("gpt-5.4-")
diff --git a/tests/agent/test_arcee_trinity_overrides.py b/tests/agent/test_arcee_trinity_overrides.py
index 63e6bbc161d..f99829521b1 100644
--- a/tests/agent/test_arcee_trinity_overrides.py
+++ b/tests/agent/test_arcee_trinity_overrides.py
@@ -96,6 +96,31 @@ def test_compression_threshold_for_codex_gpt55() -> None:
assert _compression_threshold_for_model("gpt-daybreak-blue-latest", "openai-codex") == 0.85
+ "model",
+ [
+ "gpt-5.6-sol-900k",
+ "gpt-5.6-terra-900k",
+ "gpt-5.6-luna-900k",
+ "gpt-5.4-900k",
+ "gpt-daybreak-blue-latest-900k",
+ "openai/gpt-5.6-sol-900k",
+ ],
+)
+def test_900k_variants_keep_global_threshold(model) -> None:
+ """The 85% autoraise compensates for the small 272K window; ``-900k``
+ opt-in variants run at ~900K, so they keep the user's global
+ ``compression.threshold`` (default 50%) — no override returned."""
+ assert _is_codex_gpt54_or_gpt55(model, "openai-codex") is False
+ assert _compression_threshold_for_model(model, "openai-codex") is None
+
+
+def test_base_slugs_still_autoraised_alongside_900k_variants() -> None:
+ """Sanity pair: the base slug autoraises while its variant does not."""
+ assert _compression_threshold_for_model("gpt-5.6-sol", "openai-codex") == 0.85
+ assert _compression_threshold_for_model("gpt-5.6-sol-900k", "openai-codex") is None
+
+
diff --git a/website/docs/developer-guide/context-compression-and-caching.md b/website/docs/developer-guide/context-compression-and-caching.md
index 08f2854c01f..18a70d97923 100644
--- a/website/docs/developer-guide/context-compression-and-caching.md
+++ b/website/docs/developer-guide/context-compression-and-caching.md
@@ -208,6 +208,11 @@ the model id is sent to the backend, and pricing/usage accounting treats them
as the base model. Slugs that genuinely enforce 272K (gpt-5.5, gpt-5.4-mini)
have no `-900k` variant.
+Compaction thresholds follow the window: base slugs (272K) get the **85%
+autoraise** described above, while `-900k` variants keep your global
+`compression.threshold` (default 50%, ~450K) — the autoraise exists to stop
+wasting a small window, which a 900K window doesn't need.
+
### Codex app-server thread compaction
Codex app-server sessions (`api_mode: codex_app_server` — the codex CLI/agent