GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@lidge-jun

@lidge-jun lidge-jun commented Aug 4, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Owner

Bug-stack campaign lane (devlog/_plan/260805_bug_stack_campaign/100). Fixes #992.

A routed model is not the native template: when /models omits context metadata, the entry now falls to the existing conservative 128000/128000/115200 triple instead of advertising the template's window. Known live/configured/Jawcode metadata still restores exact values; a provider context cap never invents capacity (pinned by tests).

  • bun run typecheck 0 errors; bun run privacy:scan pass; tests/codex-catalog 118/118 on this branch; full suite on ssh lidge 8314/0 (campaign tree).
  • Two tests that pinned inheritance as a feature are updated to the [Bug]: Routed models inherit native template context_window when /models omits context metadata #992 contract.

Summary by CodeRabbit

  • Bug Fixes
    • Routed catalog entries now use conservative context and auto-compaction defaults when explicit context settings are not provided.
    • Provider context limits no longer incorrectly increase the available capacity of routed entries.
    • Explicit routed context settings continue to be preserved and applied correctly.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@lidge-jun
fix(catalog): routed models never inherit the native template's conte…
c3393ba
…xt window (#992)

A routed model is not the native template. When /models omits context
metadata, the entry now falls to the existing conservative 128k/128k/
115.2k triple; known live/configured/Jawcode metadata still restores
exact values, and a provider context cap never invents capacity. Two
tests that pinned inheritance as a feature are updated to the #992
contract.
@lidge-jun
lidge-jun requested review from Ingwannu and Wibias as code owners August 4, 2026 22:42
@github-actions github-actions Bot added the bug Something isn't working label Aug 4, 2026
@coderabbitai

coderabbitai Bot commented Aug 4, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Routed 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.

Changes

Routed catalog context handling

Layer / File(s) Summary
Clear inherited metadata and validate routed defaults
src/codex/catalog/sync.ts, tests/codex-catalog.test.ts
Routed entries discard inherited context and auto-compaction limits before normalization. Tests require 128K defaults, confirm oversized provider caps do not add capacity, and preserve explicit routed context metadata with 90% auto-compaction.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • lidge-jun/opencodex#763: Both PRs modify routed catalog entry construction in src/codex/catalog/sync.ts.
  • lidge-jun/opencodex#963: Both PRs modify routed context-window metadata handling.

Suggested reviewers: ingwannu, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the fix: routed models no longer inherit context-window metadata from native templates.
Linked Issues check ✅ Passed The changes in src/codex/catalog/sync.ts and tests/codex-catalog.test.ts address issue #992 by removing inherited metadata and validating conservative defaults and cap behavior.
Out of Scope Changes check ✅ Passed The changes are limited to routed catalog context metadata handling and related regression tests, which matches issue #992 and the stated objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/lane-06-routed-context-window

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Aug 4, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@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.
🪄 Autofix

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: e432b224-91a0-4b80-80c2-0390848724cf

📥 Commits

Reviewing files that changed from the base of the PR and between 2a72aa4 and c3393ba.

📒 Files selected for processing (2)
  • src/codex/catalog/sync.ts
  • tests/codex-catalog.test.ts

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/codex-catalog.test.ts
Comment on lines +2318 to +2333
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));
});

@coderabbitai coderabbitai Bot Aug 4, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for 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.

Proposed test additions
     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.”

📝 Committable suggestion

‼️ 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.

Suggested change
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));
});
🤖 Prompt for 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.

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@lidge-jun
lidge-jun merged commit 02dbcff into dev Aug 5, 2026
36 of 38 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@lidge-jun
lidge-jun deleted the codex/lane-06-routed-context-window branch August 5, 2026 09:27
This was referenced Aug 6, 2026
fix(gui,combos): restore default effort picker and catalog combos #1092
Closed
fix(anthropic): preserve response model metadata #1122
Closed
fix(catalog): synthesize incomplete combo members with context fallback #1163
Closed
fix(catalog): restore DeepSeek V4 context window on routed rebuilds #1226
Merged
fix(catalog): apply providerContextCaps.openai to native OpenAI rows #1435
Merged
fix(codex): restore deferred tool discovery for non-Cursor routed rows #1596
Merged
This was referenced Aug 15, 2026
[Feature/UX]: streamline context-window presets/import for /models responses without metadata #1760
Closed
Routing capability evidence discards every catalog row (field-shape mismatch) #1796
Closed
feat(codex): add per-model ChatGPT compaction budgets #1905
Merged
fix: use context cap as window when upstream omits it #1991
Merged
fix(catalog): allow per-provider/model opt-out of code_mode_only tool mode (#2106) #2112
Merged
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
@lidge-jun
Merge pull request lidge-jun#1028 from lidge-jun/codex/lane-06-routed…
ff2b2d6
…-context-window

fix(catalog): routed models never inherit the native template's context window (lidge-jun#992)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@Ingwannu Ingwannu Awaiting requested review from Ingwannu Ingwannu is a code owner
@Wibias Wibias Awaiting requested review from Wibias

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

bug Something isn't working

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@lidge-jun
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.