Skip to content

feat(acp): launch pinned pre-installed CLI binary instead of npx - #3490

Merged
simonrosenberg merged 5 commits into
mainfrom
acp-prefer-pinned-binary
Jun 4, 2026
Merged

simonrosenberg merged 5 commits into
mainfrom
acp-prefer-pinned-binary

Conversation

@simonrosenberg

@simonrosenberg simonrosenberg commented Jun 3, 2026 •

Copy link
Copy Markdown
Member

What

Make the SDK launch the pinned, pre-installed ACP CLI binary instead of npx -y @<pkg>.

The agent-server image (openhands-agent-server/.../docker/Dockerfile) pre-installs the ACP CLIs at a fixed version and exposes wrappers on PATH: /usr/local/bin/{claude-agent-acp, codex-acp, gemini}. But both launch paths ignored them:

  • the SDK registry default_command is ("npx", "-y", "@<pkg>", …), and
  • agent-canvas sends an explicit acp_command=["npx","-y","@<pkg>"] in its StartConversationRequest.

Both run npx → download npm-latest at spawn time: non-reproducible, needs outbound npm, and drifts from the Dockerfile pin.

How

  • settings/acp_providers.py — add a binary_name field to ACPProviderInfo
    (claude-code→claude-agent-acp, codex→codex-acp, gemini-cli→gemini, None for custom).
    Additive, defaulted (field(default=None, compare=False)) → API-breakage check stays green.
  • settings/model.py → ACPAgentSettings.resolve_acp_command() — the single chokepoint that handles both
    the explicit acp_command and the registry default. Normalize the command: when it is an
    ["npx","-y","<provider-pkg>", *extra] invocation and the provider's binary_name resolves via
    shutil.which(), rewrite to ["<binary_name>", *extra] — preserving trailing args (e.g. gemini's --acp).
    Falls back to the npx command unchanged when:
    • the binary isn't on PATH (local dev),
    • the server is custom / has no registry entry,
    • the command isn't an npx invocation (user-supplied binary), or
    • the npx command is for a different package.

Done in resolve_acp_command, not in acp_agent.py:_start_acp_server — OpenHands/agent-canvas#2114 (now merged as OpenHands/OpenHands#3492) edits that path; this PR stays confined to settings/ to avoid conflicts. Because StartConversationRequest validation calls create_agent() → resolve_acp_command() inside the runtime pod, shutil.which() resolves against the pod's pre-installed wrappers — so the rewrite takes effect for both the registry default and the canvas-sent acp_command.

Tests

resolve_acp_command unit tests (mocking shutil.which): default + binary on PATH → [binary, *args]; explicit npx + binary → rewritten; binary absent → npx unchanged; custom binary / unknown package / custom server → untouched; which probed with binary_name; end-to-end via create_agent(). Pre-existing npx-asserting tests pin shutil.which→None so they're deterministic regardless of whether the binaries happen to be installed locally. Registry metadata tests assert the three binary_name values.

Real end-to-end validation (against a PR-built image)

Built the python agent-server image from this branch and exercised the live path in-container:

  • In-pod rewrite — all three providers' npx defaults and the explicit canvas-style npx command rewrite to the pinned binary (claude-agent-acp / codex-acp / gemini --acp, trailing arg preserved); custom/absent-binary fall back to npx.
  • Server path — POST /api/conversations with agent_kind=acp stores the resolved acp_command (['codex-acp'], ['claude-agent-acp']) — proving the rewrite runs at request-validation time in the pod.
  • Codex — container log: ACP server initialized: agent_name='codex-acp', agent_version='0.15.0' (the Dockerfile pin), 0 npx in logs.
  • Claude (real API round-trip) — routed claude-agent-acp through a LiteLLM proxy via ANTHROPIC_BASE_URL; prompt "reply with exactly: ACP_E2E_OK" → genuine model response ACP_E2E_OK, launched via pinned claude-agent-acp@0.30.0.

✅ ruff (check + format), pyright, api-breakage clean; full sdk-tests suite green.

Also in this PR

  • Merge of main — integrates Update README.md to acknowledge OpenDevin OpenHands#3492 (per-conversation CLI data-dir isolation); ACPProviderInfo now carries both binary_name and data_dir_env_var.
  • Test-isolation fix (test(sdk): hoist test-local SecretSource subclasses to module level) — several tests defined SecretSource subclasses inside test functions. SecretSource is a DiscriminatedUnionMixin: such subclasses auto-register globally, are never GC'd (pydantic caches their schema), and a function-local one (<locals> in its qualname) makes the registry raise "Local classes not supported!" on the next ConversationState deserialization sharing that xdist worker. Latent on main; this branch's added tests shifted xdist's worker distribution and exposed it (the sdk-tests failures). Fixed by hoisting the throwaway subclasses to module level (the supported pattern) in test_acp_agent.py, test_secrets_manager.py, and test_conversation_secrets_constructor.py — no production-code change.

Notes

  • Part of [ACP on Cloud] Phase 3 (Docker): run ACP against a containerized agent-server agent-canvas#2117 (task 6).
  • The typescript-client acp-providers.json mirror is intentionally not updated — canvas doesn't consume binary_name. Will update only if a drift check fails.
  • The same test-local-SecretSource pattern still exists in tests/cross/test_agent_secrets_integration.py (a separate cross-tests job/process, not currently failing) — left for a follow-up to keep this PR scoped.

🤖 Generated with Claude Code


Agent Server images for this PR

• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:dd0edb8-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-dd0edb8-python \
  ghcr.io/openhands/agent-server:dd0edb8-python

All tags pushed for this build

ghcr.io/openhands/agent-server:dd0edb8-golang-amd64
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-golang-amd64
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-golang-amd64
ghcr.io/openhands/agent-server:dd0edb8-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:dd0edb8-golang-arm64
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-golang-arm64
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-golang-arm64
ghcr.io/openhands/agent-server:dd0edb8-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:dd0edb8-java-amd64
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-java-amd64
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-java-amd64
ghcr.io/openhands/agent-server:dd0edb8-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:dd0edb8-java-arm64
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-java-arm64
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-java-arm64
ghcr.io/openhands/agent-server:dd0edb8-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:dd0edb8-python-amd64
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-python-amd64
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-python-amd64
ghcr.io/openhands/agent-server:dd0edb8-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:dd0edb8-python-arm64
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-python-arm64
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-python-arm64
ghcr.io/openhands/agent-server:dd0edb8-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:dd0edb8-golang
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-golang
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-golang
ghcr.io/openhands/agent-server:dd0edb8-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:dd0edb8-java
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-java
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-java
ghcr.io/openhands/agent-server:dd0edb8-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:dd0edb8-python
ghcr.io/openhands/agent-server:dd0edb818b8db4f6e7df551f6d9261809996cd69-python
ghcr.io/openhands/agent-server:acp-prefer-pinned-binary-python
ghcr.io/openhands/agent-server:dd0edb8-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim

About Multi-Architecture Support

  • Each variant tag (e.g., dd0edb8-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., dd0edb8-python-amd64) are also available if needed

The SDK registry default and the explicit acp_command canvas sends are
both `npx -y @<pkg>`, which downloads npm-latest at spawn time:
non-reproducible, requires outbound npm, and drifts from the version the
agent-server image pins. That image pre-installs the ACP CLIs at a fixed
version and exposes wrappers on PATH (claude-agent-acp, codex-acp,
gemini), but they were being ignored.

Add a `binary_name` field to ACPProviderInfo (additive, defaulted → API
non-breaking) and normalize the launch command in the single chokepoint,
ACPAgentSettings.resolve_acp_command(): when the command is an
`npx -y <provider-pkg>` invocation (the registry default OR an explicit
acp_command) and the provider's binary_name resolves via shutil.which(),
rewrite to `[binary_name, *extra]`, preserving trailing args like
gemini's `--acp`. Falls back to the npx command unchanged when the binary
is absent (local dev), for custom servers, and for unrelated packages.

Done in resolve_acp_command (not acp_agent._start_acp_server) to avoid
conflicting with the parallel #1019 edit there.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Python API breakage checks — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Jun 3, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-sdk/openhands/sdk/settings
   model.py5854692%93, 343, 353–356, 359, 372, 376, 382, 392, 398, 403, 606, 617, 631, 633, 635, 637, 639, 641, 643, 918, 920, 1252, 1272, 1409, 1448, 1475, 1511–1514, 1540, 1664, 1709, 1741, 1751, 1753, 1758, 1776, 1789, 1791, 1793, 1795, 1802
TOTAL28955827471% 

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ QA Report: PASS

Verified the SDK now prefers pinned ACP binaries when they are on PATH, while preserving npx fallback and custom commands.

Does this PR achieve its stated goal?

Yes. The PR set out to make ACP launch resolution use the pinned, pre-installed CLI wrappers instead of npx -y @<pkg> when those wrappers are available. I exercised the SDK settings path as a user would by importing ACPAgentSettings, creating fake executable ACP wrappers on PATH, comparing base vs PR behavior, and verifying create_agent() bakes the rewritten command into the agent.

Phase Result
Environment Setup ✅ make build completed successfully.
CI Status ⏳ At observation time: 18 successful, 1 skipped, 10 pending, 0 failing.
Functional Verification ✅ Base kept npx; PR rewrote matching provider commands to pinned binaries and preserved fallback behavior.
Functional Verification

Test 1: Provider default and explicit Canvas-style commands prefer pinned binaries

Step 1 — Reproduce / establish baseline (without the fix):
Checked out the merge-base commit 50bfa3ede2a759d54a1d051083104ca8b76d2e70, created fake executable wrappers at /tmp/qa-acp-bin/{claude-agent-acp,codex-acp,gemini}, prepended that directory to PATH, then ran:

uv run python /tmp/acp_command_qa.py

Relevant output:

default claude: ['npx', '-y', '@agentclientprotocol/claude-agent-acp']
default codex: ['npx', '-y', '@zed-industries/codex-acp']
default gemini: ['npx', '-y', '@google/gemini-cli', '--acp']
explicit canvas codex: ['npx', '-y', '@zed-industries/codex-acp', '--verbose']
explicit other package: ['npx', '-y', '@other/some-acp']
custom binary: ['/opt/my-codex', '--flag']

This confirms the old behavior ignored pinned wrappers even when matching binaries were present on PATH, continuing to use npx for built-in defaults and an explicit Canvas-style codex command.

Step 2 — Apply the PR's changes:
Checked out acp-prefer-pinned-binary at d91609a883e6fad078d6534f9ec17ad2aaea2f1c.

Step 3 — Re-run with the fix in place:
Ran the same command:

uv run python /tmp/acp_command_qa.py

Relevant output:

default claude: ['claude-agent-acp']
default codex: ['codex-acp']
default gemini: ['gemini', '--acp']
explicit canvas codex: ['codex-acp', '--verbose']
explicit other package: ['npx', '-y', '@other/some-acp']
custom binary: ['/opt/my-codex', '--flag']

This shows the PR achieves the core goal: matching built-in provider npx commands are rewritten to pinned wrapper names, Gemini's trailing --acp is preserved, and non-matching/custom commands remain unchanged.

Test 2: Agent construction, executable launch target, and fallback behavior

On the PR branch, I ran an additional SDK script that creates fake ACP wrappers, calls create_agent(), executes the resolved Gemini command, then switches to an empty PATH to verify local-dev fallback:

uv run python /tmp/acp_command_pr_edge_qa.py

Output:

create_agent codex command: ['codex-acp']
launch resolved gemini: launched gemini --acp
absent binary codex command: ['npx', '-y', '@zed-industries/codex-acp']
custom server explicit npx: ['npx', '-y', '@zed-industries/codex-acp']

This confirms the resolved binary command is what create_agent() stores on the ACP agent, the resolved command can be launched from PATH with trailing args intact, and absence of the pinned binary or a custom server leaves the original npx command untouched.

Issues Found

None.

This QA review was created by an AI agent (OpenHands) on behalf of the user.

# Conflicts:
#	openhands-sdk/openhands/sdk/settings/acp_providers.py
#	tests/sdk/settings/test_acp_providers.py
@simonrosenberg simonrosenberg self-assigned this Jun 3, 2026
@simonrosenberg simonrosenberg added the acp About ACP label Jun 3, 2026
Several tests defined `SecretSource` subclasses *inside* test functions.
`SecretSource` is a `DiscriminatedUnionMixin`: every subclass auto-registers
in a global registry and is never GC'd (pydantic caches its core schema). A
function-local subclass has `<locals>` in its qualname, which
`_get_checked_concrete_subclasses` rejects with "Local classes not supported!"
the next time *any* discriminated-union model is validated in the same process.

Under pytest-xdist this is order/worker-dependent: once a polluting test runs
on a worker, a later `ConversationState.create()` on that same worker (e.g.
tests/sdk/conversation/local/test_state_serialization.py) fails to deserialize
its `secret_registry`. It's latent on main and was exposed on this branch
because the added tests shifted xdist's worker distribution.

Fix: define the throwaway `SecretSource` subclasses at module level (the
supported pattern — importable, no `<locals>`). In test_secrets_manager.py this
also removes two same-named function-local classes that would additionally trip
the registry's "Duplicate class definition" guard.

No production code change; deterministic repro (polluting test + a
state-serialization test in one process) now passes, and the full sdk suite is
green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Trim the verbose docstrings/notes added in this PR (binary_name field,
resolve_acp_command/_prefer_pinned_binary, and the module-level SecretSource
notes) to be more concise. Comment-only; no behavior change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

all-hands-bot commented Jun 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Review complete.

This review was performed through OpenHands Cloud Automation. You can log in and view the conversation here.

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: feat(acp): launch pinned pre-installed CLI binary instead of npx

Overview

This PR introduces a mechanism to prefer pre-installed CLI binaries (like claude-agent-acp, codex-acp, gemini) over downloading packages via npx at runtime. The agent-server image now ships these ACP CLIs at fixed versions as PATH wrappers, and this change enables resolve_acp_command() to use them when available, falling back to npx when not.


🟠 Strengths

  1. Well-designed feature: The fallback behavior (npx when binary not on PATH) is correct for local dev scenarios while enabling the reproducible pinned binary path in the agent-server container.

  2. Comprehensive tests: The test suite covers all edge cases:

    • Registry default + binary on PATH → binary used
    • Explicit npx -y <pkg> + binary on PATH → rewritten to binary
    • Binary absent → npx command unchanged
    • Custom binary path → never rewritten
    • Non-matching npm package → not rewritten
    • Custom server → never rewritten
    • Trailing args (e.g., --acp for gemini) are preserved
  3. Clean separation: The _parse_npx_invocation and _prefer_pinned_binary methods are well-named, properly documented, and handle their single responsibility well.

  4. Module-level SecretSource classes: The test refactoring (moving classes outside functions) prevents the "Local classes not supported" registry issue with xdist. This is a solid fix.

  5. Proper use of compare=False: The binary_name field has compare=False which avoids breaking existing equality checks in tests.


🔍 Minor Suggestions

  1. Use functools.lru_cache for shutil.which calls (low priority): If resolve_acp_command is called multiple times, caching the which result could save some filesystem lookups. Though for typical single-agent-lifetime usage this is negligible.

  2. Consider a test for acp_env override with pinned binary: The test suite verifies that acp_env shadows registry lookups, but there is no test combining that with the pinned binary behavior. Not critical, but could provide additional confidence.

  3. Explicit None check for info: In resolve_acp_command, the get_acp_provider returning None is handled, but the error message could be more helpful by suggesting valid server names.


📝 Documentation Note

The inline docstring on binary_name in acp_providers.py is thorough. Consider also updating the SDK documentation if there is a "Connecting to ACP servers" guide to mention the new behavior.


Conclusion

This is a well-implemented feature with solid test coverage. The design correctly handles both the production use case (pinned binary on PATH) and local development (fallback to npx). The test refactoring is a necessary and beneficial side effect.

Recommendation: Approve


This review was generated by an AI agent (OpenHands) on behalf of the user through OpenHands Automation. View conversation

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 QA Report: PARTIAL

Pinned-binary command selection works locally and through the PR-built agent-server API; a live ACP prompt round-trip was not verified because ACP CLI credentials were unavailable.

Does this PR achieve its stated goal?

Yes for the command-selection path that controls ACP launch. On base main, with fake claude-agent-acp / codex-acp / gemini wrappers on PATH, SDK settings still resolved to npx; on this PR the same user-facing ACPAgentSettings flow resolved to the pinned wrappers and preserved trailing args. In the PR-built ghcr.io/openhands/agent-server:082d832-python image, real POST /api/conversations requests stored acp_command as claude-agent-acp, codex-acp, and gemini --acp, including rewriting an explicit canvas-style npx -y @zed-industries/codex-acp --verbose command to codex-acp --verbose.

Phase Result
Environment Setup ✅ uv environment available and PR image ghcr.io/openhands/agent-server:082d832-python ran locally on port 18000
CI Status ✅ Most checks green (sdk-tests, agent-server-tests, builds, API checks, etc.); qa-changes was still IN_PROGRESS; cleanup checks skipped
Functional Verification ✅ Local SDK command resolution and running server API request-validation path verified; ⚠️ live ACP model round-trip not verified
Functional Verification

Test 1: Local SDK command resolution before/after

Step 1 — Establish baseline without the fix:
Checked out origin/main at e253c5e2e7f7 and ran a small user-style script that put fake claude-agent-acp, codex-acp, and gemini wrappers on PATH, then called ACPAgentSettings(...).resolve_acp_command() / create_agent():

{
  "defaults": {
    "claude-code": ["npx", "-y", "@agentclientprotocol/claude-agent-acp"],
    "codex": ["npx", "-y", "@zed-industries/codex-acp"],
    "gemini-cli": ["npx", "-y", "@google/gemini-cli", "--acp"]
  },
  "explicit_canvas_codex": ["npx", "-y", "@zed-industries/codex-acp", "--verbose"],
  "which": {"claude-agent-acp": true, "codex-acp": true, "gemini": true}
}

This confirms the old behavior: even when pinned wrappers are available on PATH, the SDK resolves ACP providers to npx invocations.

Step 2 — Apply the PR's changes:
Checked out acp-prefer-pinned-binary at 082d832c33ea.

Step 3 — Re-run with the fix in place:
Ran the same script:

{
  "defaults": {
    "claude-code": ["claude-agent-acp"],
    "codex": ["codex-acp"],
    "gemini-cli": ["gemini", "--acp"]
  },
  "explicit_canvas_codex": ["codex-acp", "--verbose"],
  "binary_absent_codex": ["npx", "-y", "@zed-industries/codex-acp"],
  "custom_binary_codex": ["/tmp/.../my-codex", "--flag"],
  "which": {"claude-agent-acp": true, "codex-acp": true, "gemini": true}
}

This shows the fix works for the local SDK entry point: default providers and explicit canvas-style npx commands prefer pinned wrappers, Gemini keeps --acp, absent binaries fall back to npx, and custom binaries remain untouched.

Test 2: PR-built agent-server image API path

Step 1 — Establish server baseline for the changed path:
Started the PR image with Docker:

docker run --rm --name qa-acp-082d832 -p 127.0.0.1:18000:8000 ghcr.io/openhands/agent-server:082d832-python

Then confirmed the API schema exposed POST /api/conversations with StartACPConversationRequest accepting workspace and agent_settings.

Step 2 — Exercise real API requests through the runtime image:
Posted minimal ACP conversation requests to http://127.0.0.1:18000/api/conversations for each provider, plus an explicit canvas-style Codex command.

Step 3 — Observed server responses:

{
  "claude-code": {"status": 201, "acp_command": ["claude-agent-acp"]},
  "codex": {"status": 201, "acp_command": ["codex-acp"]},
  "gemini-cli": {"status": 201, "acp_command": ["gemini", "--acp"]},
  "explicit_canvas_codex": {"status": 201, "acp_command": ["codex-acp", "--verbose"]}
}

This verifies the server-side request-validation/runtime path described by the PR: conversations created in the PR-built image store the pinned binary command rather than npx, including the explicit acp_command shape that agent-canvas sends.

Unable to Verify

I did not verify a full live ACP model prompt round-trip. The available environment did not include ACP CLI credentials (Codex/Claude/Gemini auth), and a separate attempt to use fake ACP executables to observe subprocess launch hung in ACP initialization because the fake process did not speak the ACP protocol. Future QA guidance in AGENTS.md could include a safe local ACP stub command that completes initialization without external credentials.

Issues Found

None.

This QA review was created by an AI agent (OpenHands) on behalf of the user.

@VascoSch92

Copy link
Copy Markdown
Member

Closes: OpenHands/OpenHands#3487

@VascoSch92 VascoSch92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Address review feedback (VascoSch92):
- _parse_npx_invocation: use itertools.dropwhile to skip leading npx flags
  instead of a manual index loop.
- _prefer_pinned_binary: merge the package-mismatch and which()-miss guards
  into one condition (which() still short-circuits to package matches only).

Behavior-preserving; resolve_acp_command edge-case tests unchanged and green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@simonrosenberg
simonrosenberg merged commit 50776d4 into main Jun 4, 2026
32 of 33 checks passed
@simonrosenberg
simonrosenberg deleted the acp-prefer-pinned-binary branch June 4, 2026 12:59
simonrosenberg added a commit that referenced this pull request Jun 4, 2026
A second, identical module-level _FakeLookupSecret landed via a merge
collision (the pinned-binary PR #3490 added one while another PR had
already added one at the top of the file). pyright flags the
redeclaration (reportRedeclaration), failing the pre-commit check on
every PR. Keep the single definition near the top; the file-secret tests
reuse it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
simonrosenberg added a commit to Sanjays2402/software-agent-sdk that referenced this pull request Jun 8, 2026
…nHands#3357)

The three built-in ACP providers launched with floating `npx -y <pkg>`
commands, so on the native (no pre-installed binary) path the package
version was resolved from npm `latest` at agent-launch time — after commit
review and the `[tool.uv] exclude-newer` lock guardrail — and each provider
runs under a permission-disabling default session mode.

- Pin `default_command` for `claude-code`, `codex`, and `gemini-cli` via
  module-level constants matching the agent-server Dockerfile (the single
  source of truth): claude-agent-acp@0.30.0, codex-acp@0.15.0,
  gemini-cli@0.38.0.
- Make `_prefer_pinned_binary` match the provider package by name (ignoring
  any `@version`) so the image binary rewrite from OpenHands#3490 still fires for the
  pinned default and for any npx command a client sends (bare or drifted),
  while only the native fallback carries the pin.
- Fix the OpenAPI example in conversation_router_acp.py to use the scoped,
  pinned `@agentclientprotocol/claude-agent-acp@0.30.0` (the unscoped
  `claude-agent-acp` 404s on npm and is a dependency-confusion footgun).

Supersedes OpenHands#3399.

Co-authored-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
pengzhang-create pushed a commit to Pyromind-Dynamics/software-agent-sdk that referenced this pull request Aug 13, 2026
…nHands#3490)

Co-authored-by: Simon Rosenberg <simon@openhands.dev>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acp About ACP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants