Repository navigation
fix(codexcli): honor project_doc_max_bytes from .codex/config.toml in the AGENTS.md size warning - #3508
Merged
Conversation
… the AGENTS.md size warning The project instruction budget warning compared the generated AGENTS.md chain against Codex's 32 KiB default even when the project raised `project_doc_max_bytes` in `.codex/config.toml`, so it fired on every generate. Read that key from the output root's `.codex/config.toml` and use it as the budget when it is a positive integer, and name in the warning whether the default or the configured value was checked. Closes #3491 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv
…dex-doc-max-bytes # Conflicts: # src/generated/docs-content.ts
This was referenced Oct 17, 2026
This was referenced Oct 18, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 codexcli project instruction budget warning (added for #3172) always compared the generated
AGENTS.mdchain against Codex's 32 KiB default, so it fired on everygenerateeven in projects that raisedproject_doc_max_bytesin.codex/config.toml.Codex loads project-scoped
.codex/config.tomlfor trusted projects, andproject_doc_max_bytessets the byte budget for projectAGENTS.mdfiles (config reference).Changes
readCodexcliProjectDocMaxBytes(outputRoot)incodexcli-rule.tsreads top-levelproject_doc_max_bytesfrom<outputRoot>/.codex/config.toml. It returnsundefinedwhen the file is missing, is invalid TOML, or the value is not a positive integer.projectInstructionBudgetmeta gains optionalreadConfiguredBytes/configuredSource. When the configured value exists, it replaces the default budget. The warning now says which limit it checked:over the 32768-byte default limitover the 131072-byte limit set by \project_doc_max_bytes` in `.codex/config.toml``docs/reference/file-formats.md(and regenerateddocs-content.ts).Not covered
~/.codex/config.tomlis not read (the issue asks about the project config; this is documented).Testing
pnpm cicheck:contentpasses. Locally,src/utils/glob.test.ts"runs out on the number of pairs..." times out, but it times out on unmodifiedmaintoo.Closes #3491
🤖 Generated with Claude Code
https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv