Skip to content

[BUG] Regression instruction deduplication suppresses Codex AGENTS.md when .github/instructions exists #1678

@alexanderniebuhr

Description

@alexanderniebuhr

Summary

APM’s instruction deduplication introduced in 0.17.0 appears to suppress instruction content from AGENTS.md whenever .github/instructions/ exists in the output root.

This is a regression for Codex/OpenCode-style consumers of AGENTS.md: even though Copilot can read .github/instructions/, Codex does not use that directory as its instruction source. As a result, apm compile can generate an effectively empty AGENTS.md while reporting that instructions were detected and placed there.

Reproduction

Given an APM project with instruction primitives:

.apm/instructions/global.instructions.md

and targets including both Copilot and Codex:

targets:
- copilot
- codex

Run:

apm compile

The generated AGENTS.md contains only the generated header/footer and no instruction bodies.

Expected Behavior

Deduplication should only avoid duplicate context for consumers that actually read the deduplicated target.

For example:

  • Copilot may rely on .github/instructions/
  • Claude may rely on .claude/rules/
  • Codex still needs instructions folded into AGENTS.md

So when codex is a selected target, AGENTS.md should include the applicable instruction bodies even if .github/instructions/ exists.

Actual Behavior

AGENTS.md is generated without instruction content when .github/instructions/ exists.

This happens even with:

apm compile --target codex

Why This Is A Regression

This behavior appears to come from the instruction deduplication shipped in 0.17.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliCLI command surface, flags, help text (cross-cutting).area/docs-sitedocs/src/content (Starlight), README, doc generation.priority/highShips in current or next milestonestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.type/bugSomething does not work as documented.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions