Repository navigation
Conversation
Built-in adapters launch as `npx --yes <package>@latest`. When a new adapter version is published, npx installs it inside the 60s initialize timeout; Claude Code's adapter bundles a ~140 MB native agent binary, so the download is killed halfway and every retry starts over and fails the same way. The settings predownload could not prevent this: it ran `npm exec --package=<package>` without the version tag, and npx keys its install cache by the exact spec text, so it filled a cache entry the launch never reads. - Find the adapter spec in the configured npx launch and use it verbatim for both the settings predownload and a pre-launch preparation step. - Prepare local and SSH-host npx adapters under the download timeout (raised from 120s to 600s) before spawning, so the 60s cap only covers the handshake. Only a download timeout fails the launch; other preparation failures are logged and left to the launch as before. - Let callers waiting on a starting connection wait for both phases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Closing: superseded by a different approach (OpenBitFun-managed adapter install), which will be proposed separately. |
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.
Summary
Built-in ACP adapters (Claude Code, Codex) launch as
npx --yes <package>@latest. Whenever a new adapter version is published, npx installs it inside the 60sinitializetimeout. Claude Code's adapter pulls a ~140 MB native agent binary (@anthropic-ai/claude-agent-sdk-darwin-arm64, ~300 MB installed), so the install is killed halfway. Each retry starts the install over and fails the same way:The settings predownload cannot prevent this. It runs
npm exec --package=<package>without the version tag, and npx keys its install cache by the exact spec text (sha512(spec)[..16]under~/.npm/_npx). So it fills an entry the launch never reads:@agentclientprotocol/claude-agent-acp@latest(launch)_npx/b555b4fead8494dc@agentclientprotocol/claude-agent-acp(predownload)_npx/d820eb7d96bc2600This PR:
npx --yes --package=<launch spec> -- <bin> --versionunder the adapter download timeout. The 60s cap then only covers the ACP handshake. The download timeout goes from 120s to 600s, because an uninterrupted first install measured 122s here.Custom clients and non-npx commands are untouched. The requirement probe keeps its "npx present ⇒ auto-installable" fast path from cffd5b3.
Type and Areas
Type: bug fix
Areas: Rust core (
openbitfun-acpclient), desktop ACP subagents / ACP sessionsMotivation / Impact
Users with the default Claude Code ACP configuration could not start Claude Code (as a session or as a Task subagent) after an adapter release until the download happened to finish some other way. With this change, the first launch after a release waits for the download and then starts. The "配置 / Configure" button in ACP settings now actually pre-warms what the launch runs.
With an up-to-date cache, the preparation step costs about 1.7s per client start (one registry round trip plus
--version). That is once per client connection, not per prompt.Verification
Commands (on this branch):
cargo check --locked -p openbitfun-acp --no-default-features --features client cargo check --locked -p openbitfun-acp --no-default-features --features server cargo test --locked -p openbitfun-acp --no-default-features --features client,openbitfun-core/git --lib client::New unit tests in
client::requirementscover:-y,--registry=…) are preserved;npx.cmdare matched;npm exec, look-alike packages and local paths are ignored;Manual, desktop dev build on macOS (arm64), driving the real UI to delegate a Task to
acp:claude-code:initializeACP adapter ready … duration_ms=16603, thenACP client started, subagent replied~/.npm/_cacache(real network download)ACP adapter ready … duration_ms=74314(> old 60s cap),initialize2.5s, subagent repliedRemote scenarios: the SSH-host preparation path (
prepare_remote_npx_adapter) mirrors the existing remote CLI install path, but I did not exercise it against a live SSH workspace. Mobile, IM bot, Peer Device and Detached Dispatch behaviour is not affected beyond inheriting the same launch path.Reviewer Notes
acpClientsconfigs (including pinned@x.y.zargs) work unchanged.Checklist
Service error, like the existing startup timeout message.)🤖 Generated with Claude Code