fix: route --target codex/opencode through AGENTS.md compiler (#766)#769
Merged
danielmeppiel merged 3 commits intomicrosoft:mainfrom Apr 19, 2026
Merged
Conversation
…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
approved these changes
Apr 19, 2026
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.
Description
apm compile --target codexwas a silent no-op.AgentsCompiler.compile()only routed for("vscode", "agents", "all")and("claude", "all"), soapm compile --target codex(andopencode,minimal) fell through both branches and_merge_results([])returned a successful empty result — leaving any existingAGENTS.mdstale. This made distributed Codex compile look like it silently dropped a dependency instruction.should_compile_agents_md()/should_compile_claude_md()sotarget_detection.pyis the single source of truthcopilot/agentsaliases locally before routingget_target_description()so the banner matches the actual work performed for every targetFixes #766
Type of change
Testing
Manual repro from the issue: created the minimal
codex-compile-reproproject, ranapm compile --target codex—AGENTS.mdis now generated with bothpkg-aandpkg-brules (previously the file was not created at all). Added 4 new unit tests intests/unit/compilation/test_compile_target_flag.pycoveringcodex,opencode,minimal, and unknown-target failure paths. All 379 tests intests/unit/compilation/,tests/unit/core/, andtests/unit/test_install_scanning.pypass.