Skip to content

chore(agents): bump built-in Claude and Pi adapter ranges - #513

Open
lucasyarza wants to merge 4 commits into
openclaw:mainfrom
lucasyarza:chore/bump-claude-and-pi-adapter-ranges
Open

chore(agents): bump built-in Claude and Pi adapter ranges#513
lucasyarza wants to merge 4 commits into
openclaw:mainfrom
lucasyarza:chore/bump-claude-and-pi-adapter-ranges

Conversation

@lucasyarza

@lucasyarza lucasyarza commented Aug 21, 2026

Copy link
Copy Markdown

AI-assisted PR (Claude Code, claude-opus-5). Fully tested: pnpm run check passes locally, plus real launch runs for both adapters (below). I understand what the change does.

What Problem This Solves

Fresh ACPX built-in launches of the Claude and Pi agents resolve to adapter releases that are no longer current. The repository-owned range for @agentclientprotocol/claude-agent-acp sits ten minor lines behind the published release. The Pi range pins exactly, because a caret on a 0.0.x version cannot float, so it can never reach the published patch.

Users on the built-in claude and pi agents therefore stay on older adapter behavior unless they override the built-in command themselves.

Why This Change Was Made

Advance the two stale source-owned ranges in ACP_ADAPTER_PACKAGE_RANGES to the current npm releases. The Codex and Mux ranges already float to their latest published releases, so they are deliberately left untouched.

Advancing a range retires a launch command, so this PR also keeps the upgrade path intact:

  • The two superseded Claude forms are registered in the Claude spec's legacyFallbackCommands, and the superseded Pi form in LEGACY_AGENT_COMMANDS. Persisted session records without usable agent_argv resolve through those exact-command lookups, so without the entries an older record would keep reconstructing the retired launcher instead of the current built-in argv.
  • Argv backfill alone was not enough for Claude. resolveBuiltInAgentLaunch reads the unchanged persisted agent_command, and findBuiltInAgentPackage matches only fallbackCommand and legacyFallbackCommands. Putting the retired forms there is what keeps those saved sessions on the installed-package-first and package-exec paths instead of a raw npx launcher.
  • The historical built-in command table in test/session-persistence.test.ts covers all three forms. A further test asserts the documented precedence, that a usable stored agent_argv beats the historical-command map.
  • test/agent-registry.test.ts covers the launch path: package-exec resolution must recognize both retired Claude commands and bridge them at the current package range.

Harness documentation is synchronized per the repository policy: the Pi built-in is now marked as ACPX-range-owned in skills/acpx/SKILL.md, the persisted-command mapping is documented there and in agents/Claude.md, the missing agents/Pi.md is added, and it is linked first in agents/README.md to respect the mandatory example ordering. No documentation surface publishes a version specifier or semver range, and the changelog entry is generic for the same reason.

Both bumps are non-breaking. Every intervening release on the Claude line and the Pi line publishes features and fixes only, with no BREAKING CHANGE section. Notable additions picked up on the Claude line include the provider-neutral ACP goal extension, typed session failures, the model-fallback warning advisory, Skill tool call metadata, and provider switching for loaded sessions. On the Pi line, session/delete support and Pi session-settlement handling.

Boundaries: built-in names, command routing, installed-package-first resolution, package-exec fallback, queueing, persistence, cancellation, and reconnect behavior are unchanged. No adapters are added as ACPX dependencies, and the package manifest and lockfile are untouched.

User Impact

Users running acpx claude and acpx pi without an override now get the current adapter releases on a fresh launch. A session already persisted under a superseded launch command resolves to the current built-in argv instead of relaunching the retired adapter line, as long as its record carries no usable stored agent_argv. A record with usable stored argv intentionally keeps that launcher, and the docs now say so.

Evidence

Real Claude launch, end to end

acpx claude exec against this branch's build, in a scratch cwd, with --deny-all. Redacted transcript, adapter version and turn result verbatim:

$ node dist/cli.js --deny-all --timeout 180 --format json claude exec 'Reply with exactly: ACPX-PROOF-OK'

{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":1,
  "agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"0.70.0"},
  ...}}
{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"<redacted>","update":
  {"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"ACP"},...}}}
{"jsonrpc":"2.0","method":"session/update","params":{"sessionId":"<redacted>","update":
  {"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"X-PROOF-OK"},...}}}
{"jsonrpc":"2.0","id":2,"result":{"stopReason":"end_turn","usage":{"inputTokens":2,"outputTokens":14,
  "cachedReadTokens":0,"cachedWriteTokens":27550,"totalTokens":27566}}}

The launched adapter reports the newly selected release, the turn streams real model output, and it settles on end_turn.

Real legacy-session upgrade path, end to end

The path the migration exists for. A real persisted record was rewritten to its pre-upgrade shape, agent_command set to the retired npx -y @agentclientprotocol/claude-agent-acp@^0.60.0 and agent_argv removed, then reused:

$ node dist/cli.js --deny-all --timeout 240 --format json claude -s <session> 'Reply with exactly: LEGACY-RESUME-OK'

{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":1,
  "agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"0.70.0"},
  ...}}
... {"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"L"},...}
... {"sessionUpdate":"agent_message_chunk","content":{"type":"text","text":"EGACY-RESUME-OK"},...}
{"jsonrpc":"2.0","id":3,"result":{"stopReason":"end_turn",...}}
exit: 0

The retired command resolved to the current built-in argv, the newly selected adapter launched, and the turn completed. The record afterwards:

agent_command: npx -y @agentclientprotocol/claude-agent-acp@^0.60.0
agent_argv:    ["npx","-y","@agentclientprotocol/claude-agent-acp@^0.70.0"]

The resolved argv is persisted, so the upgrade is durable rather than re-derived on every reuse.

After registering the retired forms for built-in recognition, the adapter the legacy record spawns is the package-exec bridge rather than a raw npx launcher:

$ ps -o pid,ppid,command -ax | grep claude-agent-acp
74856 74847 npm exec claude-agent-acp
74892 74856 node ~/.npm/_npx/<hash>/node_modules/.bin/claude-agent-acp

# parent 74847 is the acpx queue owner:
node .../dist/cli.js __queue-owner

Before the fix the same legacy record spawned npm exec @agentclientprotocol/claude-agent-acp@^0.70.0, the raw npx form taken straight from the backfilled argv.

Real Pi launch, handshake only

Same build, Pi CLI 0.84.2 installed into a scratch prefix and put on PATH:

$ node dist/cli.js --deny-all --timeout 240 --format json pi exec 'Reply with exactly: ACPX-PROOF-OK'

{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":1,
  "agentInfo":{"name":"pi-acp","title":"pi ACP adapter","version":"0.0.33"},
  "authMethods":[{"id":"pi_terminal_login",...}],...}}
{"jsonrpc":"2.0","id":1,"error":{"code":-32000,
  "message":"Authentication required: Configure an API key or log in with an OAuth provider."}}

Stated plainly: the newly selected Pi adapter launches and completes the ACP initialize handshake at the expected release, but session/new stops at Pi provider authentication on this machine, so I cannot show a completed Pi model turn. The launch and version resolution are proven; the model turn is not.

Checks

$ pnpm run check
ℹ tests 937     ℹ tests 130
ℹ pass  937     ℹ pass  130
ℹ fail    0     ℹ fail    0
check exit: 0

The repo-local autoreview helper is clean on the branch:

$ .agents/skills/autoreview/scripts/autoreview --mode branch --base main --engine claude
autoreview clean: no accepted/actionable findings reported
overall: patch is correct (0.85)

The range and migration assertions were written first and confirmed failing against the old values before each fix:

+ actual - expected
+ '^0.60.0'
- '^0.70.0'

+ actual - expected
+ 'npx pi-acp@^0.0.31'   ->  no argv resolved
- 'npx pi-acp@^0.0.31'   ->  AGENT_ARGV_REGISTRY.pi

Published versions confirmed against the registry at the time of writing, including the two ranges left untouched:

$ npm view @agentclientprotocol/claude-agent-acp version   # 0.70.0
$ npm view pi-acp version                                  # 0.0.33
$ npm view @agentclientprotocol/codex-acp version          # 1.6.2  (already covered)
$ npm view mux version                                     # 0.28.2 (already covered)

Note for CI: the CI workflow run on this PR is parked in action_required, the first-time fork-contributor approval gate. It needs a maintainer to release it.

Generated with Claude Code

Advance the source-owned npm ranges for the Claude and Pi built-in adapters
to their current npm releases:

- `@agentclientprotocol/claude-agent-acp` `^0.60.0` -> `^0.70.0`
- `pi-acp` `^0.0.31` -> `^0.0.33`

The Codex (`^1.1.5`) and Mux (`^0.28.0`) ranges already float to the latest
published releases (1.6.2 and 0.28.2), so they are left unchanged.

Claude 0.61.0 through 0.70.0 and Pi 0.0.32 through 0.0.33 publish no breaking
changes; the release notes contain features and fixes only.

Built-in names, command routing, installed-package-first resolution,
package-exec fallback, queueing, persistence, cancellation, and reconnect
behavior are unchanged. No ACPX dependency, manifest, or lockfile changes.

Co-Authored-By: Claude <noreply@anthropic.com>
@lucasyarza
lucasyarza requested a review from a team as a code owner August 21, 2026 18:44
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 21, 2026, 6:22 PM ET / 22:22 UTC.

ClawSweeper review

What this changes

Updates ACPX’s built-in Claude and Pi adapter ranges, migrates retired launcher commands for saved sessions without stored argv, and updates the associated tests and harness documentation.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

This PR remains necessary: current main and v0.13.1 still select the older Claude and Pi ranges. The branch adds the needed persisted-session mappings and focused coverage; no correctness finding was identified, pending current-head CI validation before merge.

Priority: P2
Reviewed head: c280ac26bf34527bcbb8177f3c228bcb681baa79

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation is focused and well-proven for the changed launch and migration paths; current-head CI remains the material merge gate.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Redacted terminal output in the PR body shows a completed Claude turn and legacy resume at the new range, plus Pi initialization at its new range; provider authentication prevented only the unrelated Pi model turn.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Redacted terminal output in the PR body shows a completed Claude turn and legacy resume at the new range, plus Pi initialization at its new range; provider authentication prevented only the unrelated Pi model turn.
Evidence reviewed 7 items Current main still has the old ranges: The released main branch sets Pi to ^0.0.31 and Claude to ^0.60.0, so the central update is not already implemented.
Branch preserves retired Claude launch recognition: The PR updates the ranges and registers both retired Claude command forms in the built-in package specification used by installed-package and package-exec resolution.
Stored argv precedence is preserved: Persistence first accepts usable stored agent argv and consults historical command mapping only when argv is absent or unusable.
Findings None None.
Security None None.

Live Verification

Command: pnpm run dev -- --help

Result: PASS (completed)

pnpm run dev -- --help
runner@runnervm76f27:/tmp/clawsweeper-live-proof-513-Nqud2Y/target$ pnpm run dev -- --help

› acpx@0.13.1 dev /tmp/clawsweeper-live-proof-513-Nqud2Y/target
› tsx src/cli.ts -- --help

pnpm run dev -- --help
Usage: acpx [options] [command] [prompt...]

Headless CLI client for the Agent Client Protocol

Arguments:
  prompt                                  Prompt text

Options:
  -V, --version                           output the version number
  --agent ‹command›                       Raw ACP agent command (escape hatch)
  --cwd ‹dir›                             Working directory (default: "/tmp/clawsweeper-live-proof-513-Nqud2Y/target")
  --auth-policy ‹policy›                  Authentication policy: skip or fail when auth is required
  --approve-all                           Auto-approve all permission requests
  --approve-reads                         Auto-approve read/search requests and prompt for writes
  --deny-all                              Deny all permission requests
  --non-interactive-permissions ‹policy›  When prompting is unavailable: deny or fail
  --permission-policy ‹json-or-file›      Permission policy JSON or path (autoApprove, autoDeny, escalate, defaultAction)
  --policy ‹json-or-file›                 Alias for --permission-policy
  --format ‹fmt›                          Output format: text, json, quiet
  --suppress-reads                        Suppress raw read-file contents in output
  --model ‹id›                            Agent model id
  --allowed-tools ‹list›                  Allowed tool names as a comma-separated list (use "" for no tools)
  --max-turns ‹count›                     Maximum turns for the session
  --system-prompt ‹text›                  Replace the agent system prompt (claude-agent-acp via ACP _meta.systemPrompt)
  --append-system-prompt ‹text›           Append text to the agent system prompt (claude-agent-acp via ACP _meta.systemPrompt.append)
  --prompt-retries ‹count›                Retry failed prompt turns on transient errors (default: 0)
  --json-strict                           Strict JSON mode: requires --format json and suppresses non-JSON stderr output
  --no-fs                                 Do not advertise ACP filesystem capabilities
  --no-terminal                           Do not advertise ACP terminal capability
  --timeout ‹seconds›                     Maximum time to wait for agent response
  --ttl ‹seconds›                         Queue owner idle TTL before shutdown (0 = keep alive forever) (default: 300)
  --mcp-config ‹path›                     Load MCP servers from a JSON config file instead of project/global mcpServers
  --verbose                               Enable verbose debug logs
  -h, --help                              display help for command

Commands:
  pi [options] [prompt...]                Use pi agent
  openclaw [options] [prompt...]          Use openclaw agent
  codex [options] [prompt...]             Use codex agent
  claude [options] [prompt...]            Use claude agent
  gemini [options] [prompt...]            Use gemini agent
  cursor [options] [prompt...]            Use cursor agent
  copilot [options] [prompt...]           Use copilot agent
  droid [options] [prompt...]             Use droid agent
  fast-agent [options] [prompt...]        Use fast-agent agent
  grok-build [options] [prompt...]        Use grok-build agent
  iflow [options] [prompt...]             Use iflow agent
  kilocode [options] [prompt...]          Use kilocode agent
  kimi [options] [prompt...]              Use kimi agent
  kiro [options] [prompt...]              Use kiro agent
  mux [options] [prompt...]               Use mux agent
  opencode [options] [prompt...]          Use opencode agent
  pool [options] [prompt...]              Use pool agent
  qoder [options] [prompt...]             Use qoder agent
  qwen [options] [prompt...]              Use qwen agent
  trae [options] [prompt...]              Use trae age
… output truncated …

Assertions:

  • PASS expect_output: Headless CLI client for the Agent Client Protocol

How this fits together

ACPX maps friendly CLI agent names to npm-backed ACP adapter launch commands. When a saved session is reused, its stored argv takes precedence; otherwise ACPX maps recognized historical built-in commands to the current launcher before starting the adapter.

flowchart LR
  A[CLI agent selection] --> B[Built-in command registry]
  C[Saved session record] --> D[Historical command mapping]
  D --> E[Restored adapter argv]
  B --> F[Built-in launch resolver]
  E --> F
  F --> G[Claude or Pi ACP adapter]
  G --> H[ACP session]
Loading

Before merge

  • Resolve merge risk (P1) - This runtime range update changes fresh adapter code and the missing-argv recovery path for saved sessions; approve the fork workflow and require CI on the exact PR head before landing.
  • Complete next step (P2) - No discrete repair remains; approve the fork workflow and review the required CI result on the current head.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Patch scope 9 files affected; 81 added, 7 removed The change is concentrated in adapter resolution, saved-session migration, tests, and required harness documentation.
Production versus test delta production +5/-3, tests +43/-3 The small production change is accompanied by focused coverage for retired commands and stored-argv precedence.

Merge-risk options

Maintainer options:

  1. Validate the current head before merge (recommended)
    Approve the fork workflow and require the CI matrix to pass on the current head, including the new registry and session-persistence coverage.
  2. Accept the adapter upgrade risk
    Merge based on the supplied live Claude and Pi-launch evidence while accepting that the new adapter lines are a compatibility-sensitive runtime change.

Technical review

Best possible solution:

Land the focused range update after current-head CI confirms both fresh built-in resolution and historical-session migration behavior.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a current-main bug report: the PR body provides high-confidence after-fix terminal evidence for Claude and the legacy-session path, while Pi launch resolution is shown through its completed initialize handshake.

Is this the best way to solve the issue?

Yes. The branch updates the existing registry ownership point, retains explicit stored argv, and narrowly maps only recognized retired commands when reconstruction is required.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 2d735cf18220.

Labels

Label justifications:

  • P2: This is normal-priority maintenance of built-in adapter launches and saved-session compatibility.
  • merge-risk: 🚨 compatibility: Fresh Claude and Pi launches resolve different external adapter releases after merge.
  • merge-risk: 🚨 session-state: Sessions without usable stored argv are remapped from historical commands to the current built-in launcher.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Redacted terminal output in the PR body shows a completed Claude turn and legacy resume at the new range, plus Pi initialization at its new range; provider authentication prevented only the unrelated Pi model turn.
  • proof: sufficient: Contributor real behavior proof is sufficient. Redacted terminal output in the PR body shows a completed Claude turn and legacy resume at the new range, plus Pi initialization at its new range; provider authentication prevented only the unrelated Pi model turn.

Evidence

What I checked:

  • Current main still has the old ranges: The released main branch sets Pi to ^0.0.31 and Claude to ^0.60.0, so the central update is not already implemented. (src/agent-registry.ts:6, 2d735cf18220)
  • Branch preserves retired Claude launch recognition: The PR updates the ranges and registers both retired Claude command forms in the built-in package specification used by installed-package and package-exec resolution. (src/agent-registry.ts:104, c280ac26bf34)
  • Stored argv precedence is preserved: Persistence first accepts usable stored agent argv and consults historical command mapping only when argv is absent or unusable. (src/session/persistence/parse.ts:31, c280ac26bf34)
  • Regression coverage matches migration behavior: Tests cover the three outgoing command forms and confirm that a usable stored argv is not replaced by the migration. (test/session-persistence.test.ts:71, c280ac26bf34)
  • Historical adapter-range ownership: The prior repository adapter refresh was committed by Vitor Cepeda Lopes, establishing this registry as the existing ownership point for range maintenance. (src/agent-registry.ts:5, c5a97232e1da)
  • Release and branch provenance: v0.13.1 contains current main, while no release tag contains the PR head; the change is not yet shipped. (package.json:3, 2d735cf18220)

Likely related people:

  • Vitor Cepeda Lopes: Authored the prior built-in adapter range refresh affecting the same registry surface. (role: recent adapter-range contributor; confidence: high; commits: c5a97232e1da; files: src/agent-registry.ts)
  • Peter Steinberger: Recent main history includes structured argv and session-compatibility work adjacent to this migration path. (role: recent session compatibility contributor; confidence: medium; commits: f64e2ca4e4cc, 2d735cf18220; files: src/agent-registry.ts, src/session/persistence/parse.ts)
  • Bob: Feature history identifies the built-in adapter launch ownership work that this PR extends. (role: built-in launch ownership contributor; confidence: medium; commits: 1d61d4b23102; files: src/agent-registry.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Approve the fork workflow and confirm the required CI suite on c280ac2.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-21T18:47:22.323Z sha 1bf72f2 :: needs real behavior proof before merge. :: [P1] Migrate the superseded adapter commands | [P2] Synchronize the required harness documentation | [P2] Remove adapter ranges from the changelog
  • reviewed 2026-08-21T19:25:49.838Z sha 2e30c45 :: needs real behavior proof before merge. :: [P2] Qualify the legacy-session migration guarantee
  • reviewed 2026-08-21T19:37:16.999Z sha 8a69d0f :: needs changes before merge. :: [P1] Preserve built-in resolution for legacy Claude commands
  • reviewed 2026-08-21T19:47:47.196Z sha c280ac2 :: needs maintainer review before merge. :: none

Registering the new ranges alone left the outgoing launch commands unmapped, so
persisted sessions recorded under them reconstructed no argv and kept launching
the retired adapter line.

Add the superseded forms to `LEGACY_AGENT_COMMANDS`:

- `npx pi-acp@^0.0.31`
- `npx -y @agentclientprotocol/claude-agent-acp@^0.60.0`
- `npm exec @agentclientprotocol/claude-agent-acp@^0.60.0`

Cover all three in the historical built-in command table in
`test/session-persistence.test.ts`.

Synchronize the harness documentation the range change requires: mark the Pi
built-in as ACPX-range-owned in `skills/acpx/SKILL.md`, document the persisted
command mapping there and in `agents/Claude.md`, add the missing `agents/Pi.md`,
and link it first in `agents/README.md` per the mandatory example ordering.

Drop the adapter version specifiers from the changelog entry, which the
documentation policy forbids.

Co-Authored-By: Claude <noreply@anthropic.com>
@lucasyarza

Copy link
Copy Markdown
Author

Thanks — all four review items are addressed in 2e30c45, and the PR body is updated with the proof.

[P1] Migrate the superseded adapter commands. Confirmed and fixed. LEGACY_AGENT_COMMANDS now carries the three retired forms: npx pi-acp@^0.0.31, npx -y @agentclientprotocol/claude-agent-acp@^0.60.0, and the matching npm exec form. The Claude npm exec variant needed registering too, because legacyFallbackCommands in the registry is templated off the current range and so stops covering the outgoing one the moment it moves. All three are now rows in the historical built-in command table in test/session-persistence.test.ts, which I confirmed failing before the fix.

[P1] Resolve merge risk. Same fix. Persisted records that reconstruct argv through the exact-command map now land on the current built-in argv rather than the retired launcher.

[P2] Synchronize the required harness documentation. Done. skills/acpx/SKILL.md now marks the Pi built-in as ACPX-range-owned and documents the persisted-command mapping, agents/Claude.md documents the same, and agents/Pi.md is created and linked first in agents/README.md per the mandatory example ordering. No range or version specifier appears in any of it.

[P2] Remove adapter ranges from the changelog. Done. The Unreleased entry is now generic.

Real behavior proof. Two runs against this branch's build, both in the PR body:

  • Claude, end to end: the launched adapter reports "version":"0.70.0", the turn streams real model output, and it settles on stopReason":"end_turn".
  • Pi, handshake only: the adapter launches and completes ACP initialize at "version":"0.0.33", then session/new stops at Pi provider authentication on this machine. I am flagging that rather than dressing it up — the launch and version resolution are proven, a completed Pi model turn is not. If a completed Pi turn is required before merge, say so and I will find a machine with Pi provider credentials.

pnpm run check passes on the branch: 935 + 130 tests, 0 failures.

One thing outside my reach: the CI run on this PR is parked in action_required, the first-time fork-contributor approval gate, so no CI signal exists yet. A maintainer needs to release it.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 21, 2026
A usable stored `agent_argv` is resolved before the historical-command map, so a
record saved under a retired command only picks up the current argv when it has
no usable stored argv. The previous wording promised the migration for every
such record.

Qualify the claim in `agents/Claude.md`, `agents/Pi.md`, `skills/acpx/SKILL.md`,
and the changelog entry, and lock the precedence with a regression test that a
retired command plus usable stored argv keeps the stored launcher.

Co-Authored-By: Claude <noreply@anthropic.com>
@lucasyarza

Copy link
Copy Markdown
Author

Both remaining items are addressed in 8a69d0f.

[P2] Qualify the legacy-session migration guarantee. Correct finding, and my wording was wrong. parsePersistedAgentArgv resolves parseOptionalAgentArgv(record.agent_argv) first and only falls through to resolveAgentArgvForCommand when that yields nothing, so a record with usable stored argv keeps its stored launcher by design. The claim is now qualified in agents/Claude.md, agents/Pi.md, skills/acpx/SKILL.md, and the changelog entry. I also locked the precedence with a regression test: a retired command plus usable stored argv must keep the stored argv and must not fall back to the registry.

[P1] Real proof of the legacy no-argv upgrade path. Added, and it is the run you asked for rather than another fresh launch. A real persisted record was rewritten to its pre-upgrade shape, agent_command set to npx -y @agentclientprotocol/claude-agent-acp@^0.60.0 with agent_argv removed, then reused:

$ node dist/cli.js --deny-all --timeout 240 --format json claude -s <session> 'Reply with exactly: LEGACY-RESUME-OK'

"agentInfo":{"name":"@agentclientprotocol/claude-agent-acp","title":"Claude Agent","version":"0.70.0"}
... "agent_message_chunk" ... "L" / "EGACY-RESUME-OK"
"stopReason":"end_turn"
exit: 0

The retired command resolved to the current built-in argv, the newly selected adapter launched, and the turn completed. The record afterwards holds agent_command at the old string and agent_argv at ["npx","-y","@agentclientprotocol/claude-agent-acp@^0.70.0"], so the upgrade persists instead of being re-derived on every reuse. The scratch session was removed and the session index restored after the run.

Still not proven, same as before. A completed Pi model turn. ~/.pi/agent/auth.json on this machine is empty, so Pi has no provider credentials and session/new cannot get past authentication. Pi launch and version resolution are proven at 0.0.33; the model turn is not. If that blocks merge, say so and I will get a machine with Pi credentials.

pnpm run check passes: 936 + 130 tests, 0 failures. The repo-local autoreview helper reports autoreview clean: no accepted/actionable findings reported.

The CI run is still parked in action_required on the fork-contributor approval gate and needs a maintainer to release it.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 21, 2026
Backfilling argv was not enough. The client resolves built-in launch behavior
from the unchanged persisted `agent_command`, and `findBuiltInAgentPackage`
matches only `fallbackCommand` and `legacyFallbackCommands`. Neither retired
`^0.60.0` form appeared there, so a saved Claude session without stored argv
took a raw npx launcher and bypassed the installed-package-first and
package-exec paths that recognized Claude commands use.

Register both retired forms in the Claude spec's `legacyFallbackCommands`, which
`resolveAgentArgvForCommand` already consults before `LEGACY_AGENT_COMMANDS`, and
drop the now-duplicate entries from that map so each retired form has one home.

Cover the launch path: package-exec resolution must recognize both retired
commands and bridge them at the current package range.

Co-Authored-By: Claude <noreply@anthropic.com>
@lucasyarza

Copy link
Copy Markdown
Author

Fixed in c280ac2. The finding was right and my previous fix was incomplete.

[P1] Preserve built-in resolution for legacy Claude commands. Confirmed against the source: AcpClient.resolveAgentLaunchPlan calls resolveBuiltInAgentLaunch(this.options.agentCommand), and findBuiltInAgentPackage matches only spec.fallbackCommand and spec.legacyFallbackCommands. Claude's legacyFallbackCommands was templated off the current range alone, so neither retired ^0.60.0 form was recognized and a saved session without stored argv fell through to configuredCommand, the backfilled raw npx launcher.

Both retired forms are now in the Claude spec's legacyFallbackCommands. That list is also the second lookup inside resolveAgentArgvForCommand, so argv backfill keeps working from a single home, and I dropped the two now-duplicate entries from LEGACY_AGENT_COMMANDS.

Covered by a new test in test/agent-registry.test.ts: package-exec resolution must recognize both retired commands and bridge them at the current package range. Confirmed failing before the fix.

Live confirmation on a legacy no-argv record, same setup as the previous resume proof:

$ ps -o pid,ppid,command -ax | grep claude-agent-acp
74856 74847 npm exec claude-agent-acp
74892 74856 node ~/.npm/_npx/<hash>/node_modules/.bin/claude-agent-acp

That is the package-exec bridge. Before the fix the same record spawned npm exec @agentclientprotocol/claude-agent-acp@^0.70.0, the raw npx form straight from the backfilled argv. The turn completed at end_turn in both cases, so only the launch path changed.

One thing I deliberately did not touch. The older Claude forms already in LEGACY_AGENT_COMMANDS, the @zed-industries commands and ^0.36.1 / ^0.37.0, have the same gap: they get argv backfill but no built-in launch recognition. That predates this PR and moving them would change launch behavior for sessions this bump does not touch, so I left it for a maintainer call rather than widening a range bump. Happy to fix it here if you would rather have it in one place.

pnpm run check: 937 + 130 tests, 0 failures. Repo autoreview: autoreview clean: no accepted/actionable findings reported.

Scratch sessions used for the proofs were deleted and the session index restored. CI is still parked in action_required on the fork-contributor gate.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant