🐛 Run and plan through this build's own ACP adapters (#672) - #673
Conversation
`xmd plan` failed with both providers on a machine where Codex and Claude are installed and authenticated. Its provider was built without an agent registry, so ACPX's own table answered: `codex` spawned an `npx` of the published adapter that build pins, which runs its own bundled agent, and `claude` ran a stock adapter that never publishes the session-materialization signal a first turn waits for. `xmd run` assembled its provider the same way and had the same gap. Both now resolve agents through the overlay the workflow attachment uses — ACPX's registry with this build's two patched snapshots over the top — and materialize one at the availability probe, under `~/.xmd/adapters`. An agent this build carries no snapshot for resolves exactly as it did. The registry and the preparation are stated together by `embeddedAdapterDependencies`, so a host cannot take one without the other, and the adapters are part of the settled Agent stack: the assistant that writes a Plan and the run of the approved Plan launch from the same snapshot. Claude-Session: https://claude.ai/code/session_01TNJwcFmnt3kYSn9gGsx9u7
A patch bump: this release fixes `xmd plan` and `xmd run` resolving Codex and Claude through ACPX's stock adapter pins instead of the adapters this build carries (#672). No surface changes. Stamps every publishable manifest and restamps the matching workspace entries in bun.lock, which the bump task deliberately leaves alone. Only the ten @executablemd members move. Claude-Session: https://claude.ai/code/session_01TNJwcFmnt3kYSn9gGsx9u7
PR #673: 🐛 Run and plan through this build's own ACP adapters (#672)32 files, +338 / -71 Scope🟡 409 lines changed. PRs under 400 receive more thorough review. 🟡 32 files changed. Are all changes related? 🟡 Changes span 12 directories. 🟡 PR mixes config and source changes. StructuralOxlint structural signals:
Slop✅ Slop indicators look low. Static AnalysisOxlint: 8 diagnostics across 3 files (6 rules) no-array-sort (2): packages/acp/src/adapter-snapshots.ts CorrectnessNo extraneous code patterns detected. |
Why
xmd planin 0.10.0 fails with both providers on a machine wherecodexandclaudeare installed and authenticated (#672). The plan path builds its Agentprovider without an agent registry, so ACPX's own table answers — and that table
pins published adapters (
codex: ^0.0.44,claude: ^0.37.0) rather than thepatched snapshots this build carries.
xmd runassembles its provider the sameway and has the same gap.
What changes
Before:
xmd plan "…"— the probe spawnsnpx @agentclientprotocol/codex-acp@0.0.44,which runs its own bundled
@openai/codexand reportsCodex process has exited with code 1; the installed codex is never used.xmd plan … --default-agent=claude— the turn runs against a stock adapterthat never publishes
executablemd.session-materialization/v1, so theinvocation ends with
this session still awaits first-turn materialization.xmd runon a document naming either agent resolves the same stock pins.After:
codexandclaudeto the snapshot underpackages/acp/vendor/adapters, materialized under~/.xmd/adapters/<sha256>at the provider's availability probe. Every other agent resolves to the ACPX
command it always did.
How it works
The registry and the preparation are one statement,
embeddedAdapterDependenciesin
packages/acp/src/adapter-snapshots.ts: the overlaid registry says Codex andClaude resolve to this build's snapshot, and
prepareAgentis what puts thatsnapshot on disk before anything spawns it. The workflow attachment — which
already stated both inline — now states them the same way, so all three profiles
resolve through one mechanism rather than three that happen to agree.
The adapters are part of the settled
AgentStack, so the assistant that writes aPlan and the run of the approved Plan launch from the same snapshot.
Review guide
Start with:
packages/cli/src/agent-stack.tsThen review:
embeddedAdapterDependencies— the two clauses a carrying host states.hostAcpDependencies— now unconditional, and first, so a host assembly thatstates nothing about machine sessions still resolves this build's adapters.
authorshipCeiling— the plan path's exact dependencies, now exported so atest can read what the provider was built from.
packages/cli/tests/agent-adapters.test.ts.Look carefully at:
prepareAgentruns only when an agent isactually resolved, and only for an agent this build carries a snapshot for, so
a document that asks for no agent creates no directory.
What must stay true
overlaidAdapterRegistryand checked by AE1/AE3.resolves as it always did — checked by AE2.
How to verify it
codexandclaudeto thisbuild's adapter command, and fails if a stock
npxpin comes back.fails if the ceiling is assembled without it — the exact defect in 🐛
xmd planresolves agents through ACPX's stock registry instead of the embedded adapters #672.preparation stopped consulting
carriesEmbeddedAdapter.the resolution stops supplying adapters and leaves the provider a fallback.
Focused evidence run at
caeff5d8:All passed, plus
deno task check,deno task lintanddeno task check:jsr.Scope
Included
xmd runandxmd planprovider paths.change there).
Intentionally unchanged
beside its run store.
snapshot identity rather than by launch path, and that is untouched.
Risks and limitations
xmd run/xmd plannaming Codex or Claude now installs the snapshot(one
npm installof the vendored tarball) at the availability probe; laterinvocations reuse it. A snapshot that cannot be verified refuses the agent
rather than falling back.
an authenticated Codex or Claude. The evidence here pins the dependencies each
path hands its provider.
Scope confirmation
Fixes #672
https://claude.ai/code/session_01TNJwcFmnt3kYSn9gGsx9u7