You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The optional eager Codex MCP catalog warning could multiply a long namespace by every child tool name before checking any limit. An admitted compact request reached this diagnostic before model validation, so a small request could consume disproportionate process memory and hashing work without calling an upstream provider.
Share a per-request diagnostic budget of 4,096 inspected items and 1,048,576 UTF-16 code units.
Reserve generated-name cost before concatenation or Set insertion, including duplicates; reserve Code Mode description cost before parsing.
Bound current-turn replay scans/copies first and pass only the catalog projection to the existing provenance helper. Compact diagnostics do not inspect input history.
Skip the optional warning on exhaustion without retaining a partial count or marking the request as already warned. Keep the actual request and tool catalog unchanged.
Preserve normal deduplication, reserved functions namespace handling, deferred tools, Code Mode, current-turn provenance, and session/anonymous warning behavior.
Verification
Recorded local validation:
Independent prepatch inspection and a bounded pure-helper probe confirmed that a 20,422-byte input caused 4,195,730 canonical-name characters to be passed to Set insertion. No OOM test was needed.
All 12 new regressions failed against the original implementation.
bun test tests/responses/codex-eager-tool-catalog.test.ts: 53 passed / 149 assertions. This includes the real loopback HTTP route and an injected local upstream: all 4,096 tools are forwarded while only the warning is skipped.
Fresh independent review of the immutable implementation tree 76b27b6bf600cb46c118218c7e8db805aba2c9ea found no blocking issues. The reviewer reran the 53 focused tests and passed a further 1,221 pure in-memory assertions, including 600 generated parity cases and exact item/character/provenance boundaries.
The Spanish catalog guide includes the same diagnostic-budget exception as English. A separate review verified this three-line documentation-only delta. Spanish parity check: 30 passed / 3,226 assertions.
Posted-head CI 43812249151 passed, including the Typecheck step and test changed job. Catalog checks also passed. This is exact-head hosted evidence; the local results above are retained prior validation and were not rerun for this status change.
A source comparison against dev c36793a9336b70cfe5bc3b7f6e6f751e730fb6fc found no duplicate implementation or incompatible contract change requiring a rebase. Maintainer security review and installed/live application validation remain separate; review readiness does not claim merge or release acceptance.
Checklist
Scope stays focused and avoids unrelated cleanup.
Docs or release notes were updated when needed.
Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.
The security checkbox records implementation review; explicit maintainer security review remains required before merge.
Summary by CodeRabbit
Behavior
Catalog diagnostics now use a fixed work budget. If the catalog or surrounding request exceeds it, the warning is skipped and the request continues unchanged.
Exceeding the budget does not partially count tools or record a warning as already issued.
Documentation
Updated configuration and catalog guidance to describe the work limits and their effect on diagnostics.
No actionable comments were generated in the recent review.
Walkthrough
The eager MCP catalog diagnostic now has request-wide limits of 4,096 entries and 1 MiB of diagnostic characters. When a limit is exceeded, it skips the warning and leaves request processing unchanged. Credential excerpt masking tests now measure masking time and whole-input search counts.
Changes: Eager catalog diagnostic budget
Layer / File(s)
Summary
Bound catalog collection work src/server/responses/codex-tool-catalog.ts
The diagnostic charges catalog entries and matching names against shared item and character limits. Code Mode descriptions and rendered names also consume budget.
Apply limits across request counting and verify outcomes src/server/responses/codex-tool-catalog.ts, tests/responses/codex-eager-tool-catalog.test.ts, structure/catalog.md, docs-site/src/content/docs/reference/configuration/catalog.md, docs-site/src/content/docs/es/reference/configuration/catalog.md
The count function applies the shared limits to request inputs and returns 0 when collection exceeds a limit. Tests cover budget exhaustion, forwarding, and namespace-prefix matching. The English and Spanish documentation describe the limit and unchanged request processing.
Credential excerpt masking tests
Layer / File(s)
Summary
Measure and verify excerpt masking tests/responses/sse-untyped-credential-mask.test.ts
The tests time excerpt masking separately from the full terminal rewrite. They check that credential excerpts are masked, long suffixes remain unchanged, and masking does not repeatedly search the full input.
lidge-jun/opencodex#8133: Introduces the eager Codex MCP catalog diagnostic that this change bounds with shared entry and character limits.
Suggested reviewers:atinseau
Merge Risk: Minimal · up to f50f7
This change bounds an optional diagnostic warning and leaves request forwarding unchanged when the limit is exceeded. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title "fix(catalog): bound eager tool warning diagnostics" matches the main change. The PR adds a shared per-request budget of 4,096 items and 1,048,576 UTF-16 code units to the optional eager Cod…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "fix(catalog): bound eager tool warning diagnostics" matches the main change. The PR adds a shared per-request budget of 4,096 items and 1,048,576 UTF-16 code units to the optional eager Codex MCP catalog warning diagnostic. The title is concise, specific, and follows a conventional commit style. It does not cover every detail, such as the Spanish docs update or the test changes, which is expected.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Summary
The optional eager Codex MCP catalog warning could multiply a long namespace by every child tool name before checking any limit. An admitted compact request reached this diagnostic before model validation, so a small request could consume disproportionate process memory and hashing work without calling an upstream provider.
Verification
Recorded local validation:
bun test tests/responses/codex-eager-tool-catalog.test.ts: 53 passed / 149 assertions. This includes the real loopback HTTP route and an injected local upstream: all 4,096 tools are forwarded while only the warning is skipped.76b27b6bf600cb46c118218c7e8db805aba2c9eafound no blocking issues. The reviewer reran the 53 focused tests and passed a further 1,221 pure in-memory assertions, including 600 generated parity cases and exact item/character/provenance boundaries.Posted-head CI 43812249151 passed, including the Typecheck step and test changed job. Catalog checks also passed. This is exact-head hosted evidence; the local results above are retained prior validation and were not rerun for this status change.
A source comparison against dev
c36793a9336b70cfe5bc3b7f6e6f751e730fb6fcfound no duplicate implementation or incompatible contract change requiring a rebase. Maintainer security review and installed/live application validation remain separate; review readiness does not claim merge or release acceptance.Checklist
The security checkbox records implementation review; explicit maintainer security review remains required before merge.
Summary by CodeRabbit