Skip to content

fix: remove AGENTS.md from Codex project detection#832

Merged
pushpak1300 merged 1 commit into
laravel:mainfrom
impruthvi:fix/codex-false-positive-detection
Jun 4, 2026
Merged

fix: remove AGENTS.md from Codex project detection#832
pushpak1300 merged 1 commit into
laravel:mainfrom
impruthvi:fix/codex-false-positive-detection

Conversation

@impruthvi
Copy link
Copy Markdown
Contributor

Problem

Codex::projectDetectionConfig() included AGENTS.md in its files array alongside .codex/config.toml. FileDetectionStrategy (and CompositeDetectionStrategy) use OR logic — if any configured file/path exists, detection returns true.

Since 8 other agents (Cursor, OpenCode, Junie, Factory, Kiro, Amp, Copilot, Antigravity) write AGENTS.md as 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.md from the files array in projectDetectionConfig(). The .codex directory and .codex/config.toml are Codex-specific signals that won't trigger on other agents' projects.

Before:

'files' => ['AGENTS.md', '.codex/config.toml'],

After:

'files' => ['.codex/config.toml'],

Tests

  • Updated the existing includes config.toml in project detection test to assert AGENTS.md is not in the detection config (it was pinning the broken behaviour)
  • Added projectDetectionConfig only uses .codex dir and config.toml — config-shape test that will catch any future regression
  • Added detectInProject returns false when only AGENTS.md exists — behavioural regression test: creates a temp dir with only AGENTS.md, calls detectInProject(), asserts false

Relationship 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.md as a signal; Codex was lower severity because .codex directory was its primary signal — but the false positive still fired on projects with AGENTS.md and no .codex dir.

Checklist

  • vendor/bin/pest — 785 passed, 0 failures
  • vendor/bin/phpstan --verbose — no errors

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.
@impruthvi impruthvi force-pushed the fix/codex-false-positive-detection branch from abe2ef5 to 766898a Compare June 2, 2026 14:52
@pushpak1300 pushpak1300 merged commit 45a5229 into laravel:main Jun 4, 2026
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.

2 participants