Skip to content

feat(zones): restore Claude Code defaults to 1M model window - #18

Merged
ArkNill merged 1 commit into
mainfrom
feat/zones-restore-1m
May 20, 2026
Merged

feat(zones): restore Claude Code defaults to 1M model window#18
ArkNill merged 1 commit into
mainfrom
feat/zones-restore-1m

Conversation

@ArkNill

@ArkNill ArkNill commented May 20, 2026

Copy link
Copy Markdown
Owner

Summary

Reverts the 665K zone rescale (b185b7a / 65251cf, 2026-05-13) and restores Claude
Code zone defaults to track the 1M model window of Opus 4.7 [1m].

Why

The 665K rescale was applied on the basis of a single 2026-05-13 observation
of auto-compact firing around 650K cumulative context. Subsequent
multi-hundred-K sessions did not reproduce that trigger point — including
sessions that crossed 700K without auto-compact firing. Anthropic's documented
behavior places client-side auto-compact at ~95% of the model window, which
for Opus 4.7 [1m] is ~950K.

The 665K ceiling left the upper third of the model window unused with no
protective benefit, and the displayed "Hard 665K reached" warnings on
sessions still well within the model's actual capacity were misleading.

Changes

Proportional rescale back to 1M (matches pre-b185b7a values):

Zone Was Now
Yellow 332K 500K
Orange 465K 700K
Red 600K 900K
Hard 665K 1M
Ceiling 665K 1M

Files:

  • src/llm_relay/api/_zones.py_CACHED_TOKEN_A_* defaults + comments
  • src/llm_relay/api/display.py:1087LLM_TOKEN_CEILING env fallback
  • src/llm_relay/detect/tui.py:86 — ceiling fallback in TUI session render
  • .env.public — operational override defaults + rationale comment
  • CHANGELOG.md — supersedes the prior "rescaled to 665K" Unreleased entry

Test plan

  • pytest — 529 pass / 0 fail (the _zone_env autouse fixture in
    tests/test_api/test_turns.py already pins _CACHED_* to 1M scale, so
    the new defaults match what tests have always asserted — no test code
    changes needed).
  • ruff check src/ — clean
  • NDA grep on diff — 0 hits

Deployment notes for stock environments

Operators without 1M context entitlement (default 200K Opus / Sonnet) should
set LLM_TOKEN_CEILING=200000 (or whatever their model's actual window is)
to keep the ratio-based zones meaningful.

Reverts the 665K rescale that was applied on the basis of a single
2026-05-13 observation of auto-compact firing around 650K cumulative
context. Subsequent multi-hundred-K sessions did not reproduce that
trigger point — Opus 4.7 [1m] reaches ~95% (~950K) before client-side
auto-compact engages, so a 665K ceiling left the upper third of the
model window unused with no protective benefit.

Restored defaults (proportional to 1M):
  Yellow  500K (50%)
  Orange  700K (70%)
  Red     900K (90%)
  Hard    1M   (100%)
  Ceiling 1M

Updates:
  - src/llm_relay/api/_zones.py — _CACHED_TOKEN_A_* defaults and comments
  - src/llm_relay/api/display.py:1087 — LLM_TOKEN_CEILING fallback
  - src/llm_relay/detect/tui.py:86 — ceiling fallback in session render
  - .env.public — operational override defaults + comment

Tests: tests/test_api/test_turns.py already pins the _CACHED_* to 1M
scale via the _zone_env fixture for assertion stability, so no test
changes were needed; 529-test suite passes unchanged.

Stock deployments without 1M context entitlement can pin a smaller
ceiling via LLM_TOKEN_CEILING (e.g. =200000).
@ArkNill
ArkNill merged commit b69a94c into main May 20, 2026
6 checks passed
@ArkNill
ArkNill deleted the feat/zones-restore-1m branch May 20, 2026 06:21
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