microsoft / microsoft/apm

[BUG] Codex agent conversion leaves source-relative Markdown links unresolved

Open
#2,966 1 comment 0 reactions 1 assignee View on GitHub

@sergio-sisternes-epam is already working on this.

Since Sep 13, 2026.

area/multi-target status/accepted triage/recommended type/bug
Dominant language
Python
Stars
3.8k
Forks
362
Avg merge
1d 17h
Merged PRs (30d)
132

Description

Describe the bug

APM 0.30.0 leaves a source-relative Markdown link unchanged when converting an agent to Codex TOML. The link is valid in the source plugin but points to a nonexistent file relative to the generated agent directory. The same installation correctly rewrites the link in the Copilot output.

The referenced skill is present in the installation; the problem is the link in Codex developer_instructions, not missing package content.

To reproduce

With APM 0.30.0 available, create this apm.yml in an otherwise empty directory:

name: agent-link-repro
version: 1.0.0
dependencies:
  apm:
    - dotnet/skills/plugins/dotnet-msbuild#4c72b17fa2c2aaa307d8f1e337ec75cab45ac5c7

Run:

apm install --target copilot,codex

The command exits successfully. Generated and installed file paths below are relative to the directory containing apm.yml. Relative Markdown link destinations are resolved from the directory containing the respective source or generated agent file.

The source agent contains this link to an existing sibling skill:

[msbuild-antipatterns skill](../skills/msbuild-antipatterns/SKILL.md)
Actual Codex output

In .codex/agents/msbuild-code-review.toml, the parsed developer_instructions value retains that exact link. Relative to .codex/agents/, its destination is .codex/skills/msbuild-antipatterns/SKILL.md, which does not exist.

Working Copilot comparison

In .github/agents/msbuild-code-review.agent.md, APM rewrites the same link to:

[msbuild-antipatterns skill](../../apm_modules/dotnet/skills/plugins/dotnet-msbuild/.apm/skills/msbuild-antipatterns/SKILL.md)

That destination exists. The skill is also deployed at .agents/skills/msbuild-antipatterns/SKILL.md.

Expected behavior

A valid in-package Markdown link should remain valid after the agent is converted to Codex TOML and relocated. For this reproduction, resolving the link from the generated agent directory should reach the installed msbuild-antipatterns/SKILL.md, as the Copilot output already does.

This report does not require a particular destination layout or a general redesign of agent bundles.

Environment

  • OS: Linux x86-64.
  • APM: 0.30.0 (8c2e0d9), official standalone release binary.
  • Release: v0.30.0, published September 7, 2026; latest stable release when reproduced on September 12, 2026.

This reproduction inspects generated files only. No Codex or Copilot model session was run, so it does not establish how a model might recover through independent skill discovery.

Additional context

In the release's agent integration code, the Codex branch calls _write_codex_agent and sets links_resolved = 0. Other relevant targets call copy_agent, which invokes resolve_links. _write_codex_agent instead serializes the unchanged Markdown body into developer_instructions.

Related reports:

  • #1147 is earlier context for preserving in-package relative links. This reproduction isolates the Codex conversion path in the current stable release.
  • #2692 concerns broader agent discovery and bundle preservation. Here, the referenced resource is already retained, and the Copilot output links to it correctly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.