Skip to content

fix: route --target codex/opencode through AGENTS.md compiler (#766)#769

Merged
danielmeppiel merged 3 commits intomicrosoft:mainfrom
edenfunf:fix/codex-target-routing
Apr 19, 2026
Merged

fix: route --target codex/opencode through AGENTS.md compiler (#766)#769
danielmeppiel merged 3 commits intomicrosoft:mainfrom
edenfunf:fix/codex-target-routing

Conversation

@edenfunf
Copy link
Copy Markdown
Contributor

@edenfunf edenfunf commented Apr 19, 2026

Description

apm compile --target codex was a silent no-op. AgentsCompiler.compile() only routed for ("vscode", "agents", "all") and ("claude", "all"), so apm compile --target codex (and opencode, minimal) fell through both branches and _merge_results([]) returned a successful empty result — leaving any existing AGENTS.md stale. This made distributed Codex compile look like it silently dropped a dependency instruction.

  • Route via should_compile_agents_md() / should_compile_claude_md() so target_detection.py is the single source of truth
  • Normalize copilot/agents aliases locally before routing
  • Fail loud on unknown targets instead of silently succeeding
  • CLI progress message uses get_target_description() so the banner matches the actual work performed for every target

Fixes #766

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Manual repro from the issue: created the minimal codex-compile-repro project, ran apm compile --target codexAGENTS.md is now generated with both pkg-a and pkg-b rules (previously the file was not created at all). Added 4 new unit tests in tests/unit/compilation/test_compile_target_flag.py covering codex, opencode, minimal, and unknown-target failure paths. All 379 tests in tests/unit/compilation/, tests/unit/core/, and tests/unit/test_install_scanning.py pass.

…oft#766)

AgentsCompiler.compile() only routed for ("vscode", "agents", "all")
and ("claude", "all"), so `apm compile --target codex` (and opencode,
minimal) fell through both branches and _merge_results([]) returned a
successful empty result -- a silent no-op that left any existing
AGENTS.md stale.

- Route via should_compile_agents_md() / should_compile_claude_md()
  so target_detection.py is the single source of truth
- Normalize copilot/agents aliases locally before routing
- Fail loud on unknown targets instead of silently succeeding
- CLI progress message uses get_target_description() so the banner
  matches the actual work performed for every target
@danielmeppiel danielmeppiel added this pull request to the merge queue Apr 19, 2026
Merged via the queue into microsoft:main with commit 893a668 Apr 19, 2026
9 checks passed
danielmeppiel added a commit that referenced this pull request Apr 19, 2026
Resolve CHANGELOG conflict: keep [0.8.12] release section (which already
incorporates #616/#671/#681 from main's Unreleased), and add #766 entry
for the codex/opencode --target compile fix that landed via #769.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

apm compile --target codex is a silent no-op in distributed mode, leaving stale AGENTS.md with missing dependency instructions

2 participants