Repository navigation
fix(claude): apply per-model compact windows at launch - #8688
Conversation
Generate session-only modelSettings from the live context-window map so model switches use a compact window below each smaller model's input limit. Preserve the common default for larger models without writing Claude Code settings files. Keep explicit compact environment variables, --settings and --autocompact authoritative. Leave native fallback and Desktop launch paths unchanged.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
2/4 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
Ingwannu
left a comment
There was a problem hiding this comment.
Reviewed the complete five-file change on 297659a15ba39b0f00a8360151f7fb1833cdae16 and allowed the existing matching-head Cross-platform43418263770 and Catalog43418263738 runs. The helper is pure session-only argv/environment shaping, runs only on the routed launch path, preserves explicitly supplied compact/env/settings/autocompact policy and the positional delimiter, and leaves settings files unread/unwritten. Focused new cases cover those precedence boundaries and generated smaller-model windows; docs and the owning Claude contract were updated.
The author reports a real Claude2.1.323 switching probe; I have not independently run that native client. Other Cargo workloads prevented overlapping local validation. Hosted checks must complete, and final head-bound author readiness remains unchecked/Draft. This is ordinary source/contract review plus CI permission, not native interoperability certification or an approval/merge. No live Claude session/config or scan was touched.
|
Merge-manager review: |
|
Maintainer integration (lidge-jun, dev-only path in MAINTAINERS.md) at head
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Summary
Fix compact windows when switching between gateway models with different context limits in
ocx claude. The generated global compact environment variable currently overrides Claude Code's per-model settings, allowing a smaller model to inherit a threshold above its input limit.Pass session-only
modelSettingsfrom the live context-window map instead: preserve the common default for larger models and reserve 5% headroom for smaller eligible windows. No Claude Code settings files are written. Explicit compact env,--settings, and--autocompactremain authoritative; native fallback and Desktop behavior are unchanged.Verification
bun scripts/test.ts --changed=origin/dev— 1,263 tests passed./contextchanged 829.8k → 497.8k → 829.8k without restarting.Checklist
Review readiness checklist
🤖 Generated with Claude Code