Skip to content

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

Open
edenfunf wants to merge 2 commits intomicrosoft:mainfrom
edenfunf:fix/codex-target-routing
Open

fix: route --target codex/opencode through AGENTS.md compiler (#766)#769
edenfunf wants to merge 2 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
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