GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(catalog): routed models never inherit the native template's context window (#992) by lidge-jun · Pull Request #1028 · lidge-jun/opencodex Conversation
|
📝 WalkthroughWalkthroughRouted catalog entries no longer inherit context metadata from native templates. The sync path clears inherited values before normalization. Tests verify conservative defaults, provider-cap handling, and preservation of explicit routed metadata. ChangesRouted catalog context handling
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
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 `@tests/codex-catalog.test.ts`:
- Around line 2318-2333: Extend both routed-capacity tests around
buildCatalogEntries to assert the complete context contract: context_window,
max_context_window, and auto_compact_token_limit. For the oversized contextCap
case, verify all three values remain capped at the expected routed capacity; for
explicit contextWindow metadata, verify max_context_window matches 256,000 and
auto_compact_token_limit remains floor(256,000 × 0.9), alongside the existing
context_window assertions.
Fix all unresolved CodeRabbit comments on this PR:
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: e432b224-91a0-4b80-80c2-0390848724cf
src/codex/catalog/sync.tstests/codex-catalog.test.ts
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| test("a provider context cap never invents routed capacity (#992)", () => { | ||
| const entries = buildCatalogEntries({ context_window: 372_000 }, [], [ | ||
| { provider: "relay", id: "relay-model", contextCap: 950_000 }, | ||
| ]); | ||
| const routed = entries.find(e => e.slug === "relay/relay-model"); | ||
| expect(routed?.context_window).toBe(128_000); | ||
| }); | ||
|
|
||
| test("known routed metadata still restores the exact context window (#992)", () => { | ||
| const entries = buildCatalogEntries({ context_window: 372_000 }, [], [ | ||
| { provider: "relay", id: "relay-model", contextWindow: 256_000 }, | ||
| ]); | ||
| const routed = entries.find(e => e.slug === "relay/relay-model"); | ||
| expect(routed?.context_window).toBe(256_000); | ||
| expect(routed?.auto_compact_token_limit).toBe(Math.floor(256_000 * 0.9)); | ||
| }); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Assert the complete routed context contract.
Lines 2318-2324 assert only context_window for an oversized contextCap. A regression can advertise capacity through max_context_window or auto_compact_token_limit and still pass this test.
Lines 2326-2333 also omit max_context_window for explicit contextWindow metadata. Assert the full expected triples in both tests.
expect(routed?.context_window).toBe(128_000); + expect(routed?.max_context_window).toBe(128_000); + expect(routed?.auto_compact_token_limit).toBe(115_200); @@ expect(routed?.context_window).toBe(256_000); + expect(routed?.max_context_window).toBe(256_000); expect(routed?.auto_compact_token_limit).toBe(Math.floor(256_000 * 0.9));
As per path instructions, “A behavior change in src/ should come with a focused regression test near the existing tests for that subsystem.”
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| test("a provider context cap never invents routed capacity (#992)", () => { | |
| const entries = buildCatalogEntries({ context_window: 372_000 }, [], [ | |
| { provider: "relay", id: "relay-model", contextCap: 950_000 }, | |
| ]); | |
| const routed = entries.find(e => e.slug === "relay/relay-model"); | |
| expect(routed?.context_window).toBe(128_000); | |
| }); | |
| test("known routed metadata still restores the exact context window (#992)", () => { | |
| const entries = buildCatalogEntries({ context_window: 372_000 }, [], [ | |
| { provider: "relay", id: "relay-model", contextWindow: 256_000 }, | |
| ]); | |
| const routed = entries.find(e => e.slug === "relay/relay-model"); | |
| expect(routed?.context_window).toBe(256_000); | |
| expect(routed?.auto_compact_token_limit).toBe(Math.floor(256_000 * 0.9)); | |
| }); | |
| test("a provider context cap never invents routed capacity (`#992`)", () => { | |
| const entries = buildCatalogEntries({ context_window: 372_000 }, [], [ | |
| { provider: "relay", id: "relay-model", contextCap: 950_000 }, | |
| ]); | |
| const routed = entries.find(e => e.slug === "relay/relay-model"); | |
| expect(routed?.context_window).toBe(128_000); | |
| expect(routed?.max_context_window).toBe(128_000); | |
| expect(routed?.auto_compact_token_limit).toBe(115_200); | |
| }); | |
| test("known routed metadata still restores the exact context window (`#992`)", () => { | |
| const entries = buildCatalogEntries({ context_window: 372_000 }, [], [ | |
| { provider: "relay", id: "relay-model", contextWindow: 256_000 }, | |
| ]); | |
| const routed = entries.find(e => e.slug === "relay/relay-model"); | |
| expect(routed?.context_window).toBe(256_000); | |
| expect(routed?.max_context_window).toBe(256_000); | |
| expect(routed?.auto_compact_token_limit).toBe(Math.floor(256_000 * 0.9)); | |
| }); |
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/codex-catalog.test.ts` around lines 2318 - 2333, Extend both
routed-capacity tests around buildCatalogEntries to assert the complete context
contract: context_window, max_context_window, and auto_compact_token_limit. For
the oversized contextCap case, verify all three values remain capped at the
expected routed capacity; for explicit contextWindow metadata, verify
max_context_window matches 256,000 and auto_compact_token_limit remains
floor(256,000 × 0.9), alongside the existing context_window assertions.
Source: Path instructions
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…-context-window fix(catalog): routed models never inherit the native template's context window (lidge-jun#992)
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.