Skip to content

fix: correct context percentage calculation for all models#13

Merged
kostyay merged 2 commits intomainfrom
fix/context-percentage
Jan 12, 2026
Merged

fix: correct context percentage calculation for all models#13
kostyay merged 2 commits intomainfrom
fix/context-percentage

Conversation

@kostyay
Copy link
Owner

@kostyay kostyay commented Jan 12, 2026

Summary

  • Only models with [1m] suffix have 1M context
  • All other models (Sonnet 4, Sonnet 4.5, Opus 4.5, etc.) use 200k default
  • Fixes incorrect matching where claude-sonnet-4 was treated as 1M context

Problem

User with claude-sonnet-4-5-20250929 at 114k/200k tokens saw:

  • Expected: 57%
  • Actual: 12.4% (was calculating 114k/1M)

Test plan

  • Tests pass (updated test cases to reflect correct behavior)
  • Lint passes

🤖 Generated with Claude Code

Only models with [1m] suffix have 1M context. All others (including
Sonnet 4 and Sonnet 4.5) use 200k default context.

Previously claude-sonnet-4 was incorrectly matched for 1M context,
causing 114k/1M = 11% instead of correct 114k/200k = 57%.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@kostyay kostyay force-pushed the fix/context-percentage branch from f84bea6 to dc5637d Compare January 12, 2026 17:43
@kostyay kostyay merged commit 2dcf75f into main Jan 12, 2026
3 checks passed
@kostyay kostyay deleted the fix/context-percentage branch January 12, 2026 18:55
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