fix(claude): honor authoritative context windows in generated profiles - #854
fix(claude): honor authoritative context windows in generated profiles#854park285 wants to merge 6 commits into
Conversation
📝 WalkthroughWalkthroughClaude model metadata now uses registry context windows. Claude roster and self-clone definitions normalize ChangesSubagent context marker handling
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Pre-merge review result: not merge-ready yet. The narrow GPT fix direction is correct (
Happy to re-review once the metadata source of truth is reconciled and CI runs. |
- align Anthropic registry and generated catalog windows with the 1M source values - preserve exact routed selectors while honoring provider context caps - normalize marker case and cover roster, self, catalog, and registry boundaries
|
Addressed the pre-merge findings in
The branch now includes the latest This PR now absorbs the overlapping source-of-truth work requested on #839. Please re-review this head; hosted cross-platform CI and maintainer approval remain the external merge gates. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/claude/agents-inject.ts`:
- Around line 62-71: Update withSubagentContextMarker to preserve an existing
[1m] marker when no positive matching window metadata exists; only strip the
marker when an authoritative positive window indicates a sub-1M context, while
retaining current auto-marking behavior for eligible windows. Add an end-to-end
regression using incomplete catalog-derived Claude 4.6 and 4.7 metadata that
covers both roster and self-clone generation paths.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 01e943b1-2719-4c8c-831f-db41e09ad3e0
📒 Files selected for processing (2)
scripts/generate-jawcode-metadata.tssrc/claude/agents-inject.ts
|
Follow-up on the CodeRabbit finding:
Verification on head
|
|
Superseded by #889, which ports this PR's |
|
특붕이 잘쓰고있어요 유지보수 감사합니다. |
Summary
[1m]markers to authoritative effective context windows of at least 1M[1m]model IDs while honoring provider caps and case-insensitive marker spelling[1m]selector when context metadata is missing or non-positive, stripping it only when a positive authoritative window proves sub-1MProblem
Generated agent profiles reused the main-session auto-context predicate, so a 372K native route could be written with
[1m]. The Anthropic registry and generated jawcode metadata also disagreed about Claude 4.6/4.7 windows, allowing valid 1M selectors to lose their marker during catalog-to-profile generation.The marker is also overloaded: it can be Claude's context-accounting suffix or part of a real routed selector such as Kimi
k3[1m]. Unconditional stripping loses the real selector, while unconditional preservation can ignore an effective provider context cap.Missing metadata is not evidence of a sub-1M context. Catalog-derived selectors that already carry
[1m]must therefore keep it unless a positive effective window explicitly proves otherwise.Fix
fetchProviderModels()andbuildClaudeContextWindows()in regression coverage[1m]marker for exact lookup, preserving the rest of the model ID and honoring raw exact-key precedenceThis absorbs the shared source-of-truth reconciliation requested on #839.
Verification
JAWCODE_MODELS_JSON=/tmp/opencodex-jawcode-854/opencodex-snapshot.json npx --yes bun@1.3.14 test --isolate tests/claude-agents-inject.test.ts tests/claude-context-windows.test.ts tests/codex-catalog.test.ts tests/provider-registry-parity.test.ts tests/jawcode-metadata-sync.test.ts— 178 passed, 0 failednpx --yes bun@1.3.14 x tsc --noEmit— passedJAWCODE_MODELS_JSON=/tmp/opencodex-jawcode-854/opencodex-snapshot.json npx --yes bun@1.3.14 scripts/test.ts— 6,963 passed, 9 skipped, 0 failedgit diff --check origin/dev— passed for the PR-relative diffChecklist
Summary by CodeRabbit
[1m]marker.