Skip to content

[WRONG BRANCH] fix(claude): withhold ambiguous bare context windows - #332

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-context-window-vulnerability
Draft

[WRONG BRANCH] fix(claude): withhold ambiguous bare context windows#332
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-context-window-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Motivation

  • A mismatch in buildClaudeContextWindows allowed rows that were skipped for registration (missing/zero window or Anthropic <1M) to be ignored when deciding whether a bare model ID was ambiguous, which could cause a bare selector to be marked [1m] even though routing might resolve it to a different provider.

Description

  • Change buildClaudeContextWindows to count ambiguity over every routedModels row (not just the registrable subset) so any provider that can route the bare id vetoes automatic bare-key registration.
  • Preserve the registrable set for writing provider-qualified context-window entries and the desktop/native alias registration logic.
  • Update the tests in tests/claude-context-windows.test.ts to assert that bare aliases are withheld when another provider could route the same id even if that provider did not register a positive window, and to verify provider-qualified keys remain present.

Testing

  • Ran the focused test file with ./node_modules/.bin/bun test tests/claude-context-windows.test.ts, which passed (16 tests, 0 failures).
  • Typecheck with ./node_modules/.bin/bun run typecheck passed and ./node_modules/.bin/bun run privacy:scan passed.
  • Attempted the repository-wide ./node_modules/.bin/bun run test but stopped after uncovering unrelated, environment-sensitive failures/timeouts; the change is covered by the focused regression test and the typecheck/privacy scan results.

Codex Task

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 16b4cd7f-a0ab-4475-9256-bbcea2e99601


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 26, 2026
@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions github-actions Bot changed the title fix(claude): withhold ambiguous bare context windows [WRONG BRANCH] fix(claude): withhold ambiguous bare context windows Aug 26, 2026
@github-actions
github-actions Bot marked this pull request as draft August 26, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant