fix: remove AGENTS.md from Codex project detection#832
Merged
pushpak1300 merged 1 commit intoJun 4, 2026
Conversation
FileDetectionStrategy uses OR logic, so any project with an AGENTS.md file (written by Cursor, Junie, Factory, Kiro, Amp, Copilot, Antigravity, or OpenCode) was falsely detected as a Codex project. The .codex directory and .codex/config.toml are the reliable, Codex-specific signals. Removes AGENTS.md from the files array in projectDetectionConfig(), updates the existing test that pinned the broken behaviour, and adds a config-shape test plus a behavioural regression test that proves the false positive is gone.
abe2ef5 to
766898a
Compare
2 tasks
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.
Problem
Codex::projectDetectionConfig()includedAGENTS.mdin itsfilesarray alongside.codex/config.toml.FileDetectionStrategy(andCompositeDetectionStrategy) use OR logic — if any configured file/path exists, detection returnstrue.Since 8 other agents (Cursor, OpenCode, Junie, Factory, Kiro, Amp, Copilot, Antigravity) write
AGENTS.mdas their guidelines file, any project using those agents was falsely detected as a Codex project. This caused Boost to incorrectly install Codex configuration for users who don't have Codex.Fix
Remove
AGENTS.mdfrom thefilesarray inprojectDetectionConfig(). The.codexdirectory and.codex/config.tomlare Codex-specific signals that won't trigger on other agents' projects.Before:
After:
Tests
includes config.toml in project detectiontest to assertAGENTS.mdis not in the detection config (it was pinning the broken behaviour)projectDetectionConfig only uses .codex dir and config.toml— config-shape test that will catch any future regressiondetectInProject returns false when only AGENTS.md exists— behavioural regression test: creates a temp dir with onlyAGENTS.md, callsdetectInProject(), assertsfalseRelationship to #831
This is the follow-up to #831 (OpenCode false-positive fix). Same root cause, same pattern, same fix. OpenCode was higher severity because it had only
AGENTS.mdas a signal; Codex was lower severity because.codexdirectory was its primary signal — but the false positive still fired on projects withAGENTS.mdand no.codexdir.Checklist
vendor/bin/pest— 785 passed, 0 failuresvendor/bin/phpstan --verbose— no errors