Repository navigation
fix(agents-md-budget): sum every tracked AGENTS.md against Codex's shared budget #300
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| | What | Files or functions | Upstream code touched | Status | Last checked sync | | ||
| | --- | --- | --- | --- | --- | | ||
| | The `AGENTS.md` byte-budget check sums the root and every nested `AGENTS.md` git tracks, because Codex shares one `project_doc_max_bytes` budget across the chain, and its overrun points at "Maintaining this file" and says to prune, not raise the limit | `bin/fm-agents-md-budget.sh`, `tests/fm-agents-md-budget.test.sh`, `docs/scripts.md`, `bin/fm-test-run.sh` (the `*/AGENTS.md` selection) | `docs/scripts.md`, `bin/fm-test-run.sh` | carried | 427056c4 | |
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
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
Oops, something went wrong.
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.
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.
A new nested AGENTS.md that has not been staged yet is not counted, so the local check passes while CI fails once the file is committed. The chain comes from
git ls-files, which lists only indexed paths. Codex itself reads any AGENTS.md on disk in the chain, whether or not git tracks it. Fix: also list untracked files that are not ignored (git ls-files --cached --others --exclude-standard -- AGENTS.md '*/AGENTS.md'). That keepsprojects/out and counts a file a worker just created.Failure scenario: A worker creates docs/AGENTS.md (3 KB) in a worktree whose root AGENTS.md is 28,234 bytes. It runs
bin/fm-test-run.sh --nearbeforegit add, and the budget test reports ok at bytes=28234. The worker commits and opens the PR, and CI fails at 31,234 bytes, over the 30,720 limit. The local check missed what it exists to catch.