Skip to content

fix(codexcli): honor project_doc_max_bytes from .codex/config.toml in the AGENTS.md size warning - #3508

Merged
dyoshikawa merged 2 commits into
mainfrom
resolve-issue-3491-codex-doc-max-bytes
Oct 17, 2026
Merged

dyoshikawa merged 2 commits into
mainfrom
resolve-issue-3491-codex-doc-max-bytes

Conversation

@dyoshikawa

Copy link
Copy Markdown
Owner

Summary

The codexcli project instruction budget warning (added for #3172) always compared the generated AGENTS.md chain against Codex's 32 KiB default, so it fired on every generate even in projects that raised project_doc_max_bytes in .codex/config.toml.

Codex loads project-scoped .codex/config.toml for trusted projects, and project_doc_max_bytes sets the byte budget for project AGENTS.md files (config reference).

Changes

  • readCodexcliProjectDocMaxBytes(outputRoot) in codexcli-rule.ts reads top-level project_doc_max_bytes from <outputRoot>/.codex/config.toml. It returns undefined when the file is missing, is invalid TOML, or the value is not a positive integer.
  • projectInstructionBudget meta gains optional readConfiguredBytes / configuredSource. When the configured value exists, it replaces the default budget. The warning now says which limit it checked:
    • over the 32768-byte default limit
    • over the 131072-byte limit set by \project_doc_max_bytes` in `.codex/config.toml``
  • Dropped the "(ignore this warning if you already have)" clause from the remedy text, since a raised value is now honored.
  • Updated the Codex CLI note in docs/reference/file-formats.md (and regenerated docs-content.ts).

Not covered

  • A value set only in the user-level ~/.codex/config.toml is not read (the issue asks about the project config; this is documented).

Testing

  • Unit tests for the reader (missing file, unset key, key only inside a table, invalid types, invalid TOML) and for the processor (no warning under a raised budget, warning against a configured budget with its source, output-root-relative lookup, default-limit wording).
  • pnpm cicheck:content passes. Locally, src/utils/glob.test.ts "runs out on the number of pairs..." times out, but it times out on unmodified main too.

Closes #3491

🤖 Generated with Claude Code

https://claude.ai/code/session_012y9fNo2AAJdGocxvsHtDhv

dyoshikawa and others added 2 commits October 17, 2026 21:45
… 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
@dyoshikawa
dyoshikawa merged commit a26a109 into main Oct 17, 2026
9 checks passed
@dyoshikawa
dyoshikawa deleted the resolve-issue-3491-codex-doc-max-bytes branch October 17, 2026 13:15
dyoshikawa added a commit that referenced this pull request Oct 17, 2026
…llowups

fix: address low-severity review follow-ups from #3508-#3514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

codexcli: AGENTS.md size warning ignores project_doc_max_bytes set in .codex/config.toml

1 participant