Skip to content

feat(acp): add Hermes as a built-in provider, installed from a pinned git checkout - #4864

Closed
simonrosenberg wants to merge 17 commits into
mainfrom
acp-hermes-provider
Closed

simonrosenberg wants to merge 17 commits into
mainfrom
acp-hermes-provider

Conversation

@simonrosenberg

@simonrosenberg simonrosenberg commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

Hermes is the last harness in the #4627 comparison set, and #4634 specified an install
route (uvx --from git+…@<tag>) that turns out to be impossible — Hermes blocks wheel
builds on purpose. Please review the mechanism here rather than just the diff: this
lands a shallow git checkout plus uv sync as a third install flavour, which is a real
addition to the catalog's surface. The registry values were read off a live server and
the whole thing is validated end-to-end against the eval LiteLLM proxy; the eval
preinstall question is deliberately left open.


AGENT:

Why

#4634 asks for Hermes as a built-in ACP provider via uvx --from git+<url>@<tag> hermes acp, on the constraint that it must not add weight to the published agent-server images. That command cannot work, for three independent reasons verified against v2026.8.31:

  1. Hermes blocks wheel and sdist builds by design. setup.py overrides bdist_wheel/sdist to raise unless HERMES_NIX_BUILD=1 — "Hermes is distributed via the shell installer, Docker image, or Nix." uvx always resolves a distribution through PEP 517 build_wheel, so this fires for a git ref, a tarball or a local path alike.
  2. The guard protects something real. Forcing the build does produce a runnable ACP server, but [tool.setuptools.packages.find] never packaged skills/, locales/ or optional-mcps/. A wheel-built Hermes silently loses its skills system — the product's headline capability — which would invalidate any harness comparison under epic [Harness Watch] Epic — automated paired ACP harness comparison #4627.
  3. uv's git backend does not complete against this repository. It resolves the ref then re-fetches by commit SHA, triggering an unfiltered ref advertisement over 105,697 refs. git ls-remote unfiltered takes 438 s here vs 8 s with a ref-prefix; the fetch aborts at fatal: expected flush after ref listing (reproduced twice, at 1402 s and 605 s). Upstream's own scripts/install.sh documents this same GitHub throttle and works around it with retries plus a blobless partial clone.

Two premises in the issue also don't hold: the curl | bash installer is pinnable (--branch NAME → git clone --depth 1 --single-branch --branch "$BRANCH", which takes a tag), and uvx is not the equivalent of npx here — npx runs a prebuilt artifact, uvx has to build one.

Summary

  • Adds a third install flavour to ACP_INSTALL_CATALOG, ACPGitCheckoutInstallSpec, rendering what upstream's own installer does: a shallow single-branch clone of the pinned tag plus uv sync --frozen --extra acp. --single-branch --branch <tag> asks for one ref prefix instead of the full advertisement (the 8 s vs 438 s difference), and the editable install is the path the wheel guard explicitly permits, so the bundled assets survive.
  • default_command is the bare console script. ACPAgent materialises the checkout under the conversation's durable cache root (beside the existing npm-cache, keyed by pin so a bump installs alongside rather than over) and prepends its venv bin to the subprocess PATH.
  • Keeps Hermes out of every published image: render_docker_install_plan rejects the flavour, so INSTALL_ACP_PROVIDERS=hermes fails the build with an actionable message instead of handing a git URL to npm install -g. BuildOptions now validates through that same resolver, so the failure lands at option-parse time rather than minutes into a Docker build.
  • Registry entry read off a live hermes-acp rather than assumed — see the table below.
  • Fixes an npm-specific assumption in _log_acp_provider_version, which scanned default_command for pkg@version and would have warned "not the pinned build" on every Hermes start. Both flavours now expose pinned_version.

Issue Number

Closes #4634

How to Test

Live conformance probe — exercises clone → sync → launch → initialize → authenticate → session/new → set_session_mode → version assertion, credential-free:

uv run pytest tests/sdk/agent/test_acp_conformance.py -m acp_live -k hermes
# 1 passed in 97.27s

End-to-end through the eval LiteLLM proxy, driven by ACPAgent itself:

OPENAI_API_KEY=<litellm key> OPENAI_BASE_URL=https://llm-proxy.eval.all-hands.dev
model: openai-api:claude-sonnet-4-6

Hermes read calc.py, fixed a seeded a - b → a * b bug, ran pytest (self-healing a missing pytest along the way) and reported 2 passed:

[measure] cold_start=29.9s
[measure] agent_name='hermes-agent' version='0.21.0'
[measure] checkout=https-github.com-NousResearch-hermes-agent-v2026.8.31 size=434MB
[measure] warm_start=1.8s
[measure] current_model_id='openai-api:claude-sonnet-4-6'
[measure] turn=11.7s stop=stop_reason='end_turn' usage=Usage(input_tokens=41888, output_tokens=289, total_tokens=42177)

Cold figures are fully cold — fresh clone and a fresh UV_CACHE_DIR created by the agent itself. Warm start is comfortably inside the 90 s acp_startup_timeout; the install runs under its own budget (ACP_CHECKOUT_INSTALL_TIMEOUT, default 900 s) because it is bandwidth-dominated (on a degraded ~730 KB/s link the same install takes 7–10 minutes).

Image size is unchanged — asserted, not just claimed:

uv run pytest tests/sdk/settings/ tests/cross/test_agent_server_build_metadata.py \
  tests/agent_server/test_docker_build.py tests/sdk/agent/test_acp_agent.py \
  tests/sdk/test_settings.py
# 777 passed
python3 -S openhands-sdk/openhands/sdk/settings/acp_install_catalog.py hermes
# ACP provider 'hermes' ... is not npm-installable ... leave it out of INSTALL_ACP_PROVIDERS

TypeScript mirror: python scripts/check-acp-drift.py → OK ... (7 providers); npm test -- acp-providers → 19 passed; tsc --noEmit clean.

Registry values, verified against a live server

field value how it was determined
agentInfo.name / version hermes-agent / 0.21.0 the version is not the CalVer tag — separate namespaces, hence reported_version in the catalog so the drift check stays meaningful
default_session_mode dont_ask modes are default / accept_edits / dont_ask; Hermes maps ACP modes onto its edit-approval policy, not onto permissions wholesale
model selection session/set_model session/new returns a model state and no configOptions; set_config_option answers with an empty list
available_models uncurated ids are <hermes-provider>:<model> and Hermes lists only providers it can authenticate — against the proxy the list is the proxy's catalogue (208 entries)
api_key_env_var / base_url_env_var OPENAI_API_KEY / OPENAI_BASE_URL resolves Hermes' openai-api provider; this is the pair that routes it at LiteLLM
data_dir_env_var HERMES_HOME
auth terminal-only when unconfigured with a credential it also offers an agent method named for the resolved provider; a syntactically-valid bogus OPENAI_API_KEY clears session/new, so the credential-free probe covers it

Notes for the reviewer

  • uv sync writes the venv's absolute path into every console-script shebang, so the obvious "build in staging, rename into place" pattern yields a venv whose exec target no longer exists. Only the clone stages and renames; the install runs in place, with a marker file rather than directory existence as the ready signal. test_installs_in_place_rather_than_in_the_staging_clone pins that.
  • tests/sdk/test_settings.py and tests/sdk/settings/test_acp_providers.py had hardcoded provider-key literals; both now derive from ACP_PROVIDERS, so the next provider doesn't have to update them. test_acp_server_kind_matches_registry_keys remains the guard on the registry itself.
  • Still open, deliberately out of scope: eval preinstall (the acp-providers build stage is npm-only by construction — its payload is shared byte-for-byte across base images — so that needs its own decision before [Harness Watch] Run scheduled comparisons through the existing evaluation workflow #4637 schedules comparisons), and Canvas/Cloud exposure per Each client declares which ACP harnesses it offers — adding one to the SDK must not reach Cloud or Replicated #4841.

🤖 Generated with Claude Code

https://claude.ai/code/session_013xcUBSCfDEUysWgHYGkHY6


🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)

• 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-slim amd64, arm64 nikolaik/python-nodejs:python3.13-nodejs22-slim 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:c212367-python

Run

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

All tags pushed for this build

ghcr.io/openhands/agent-server:c212367-golang-amd64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-golang-amd64
ghcr.io/openhands/agent-server:acp-hermes-provider-golang-amd64
ghcr.io/openhands/agent-server:c212367-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:c212367-golang-arm64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-golang-arm64
ghcr.io/openhands/agent-server:acp-hermes-provider-golang-arm64
ghcr.io/openhands/agent-server:c212367-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:c212367-java-amd64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-java-amd64
ghcr.io/openhands/agent-server:acp-hermes-provider-java-amd64
ghcr.io/openhands/agent-server:c212367-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:c212367-java-arm64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-java-arm64
ghcr.io/openhands/agent-server:acp-hermes-provider-java-arm64
ghcr.io/openhands/agent-server:c212367-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:c212367-python-amd64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-python-amd64
ghcr.io/openhands/agent-server:acp-hermes-provider-python-amd64
ghcr.io/openhands/agent-server:c212367-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-amd64
ghcr.io/openhands/agent-server:c212367-python-arm64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-python-arm64
ghcr.io/openhands/agent-server:acp-hermes-provider-python-arm64
ghcr.io/openhands/agent-server:c212367-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-arm64
ghcr.io/openhands/agent-server:c212367-python-slim-amd64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-python-slim-amd64
ghcr.io/openhands/agent-server:acp-hermes-provider-python-slim-amd64
ghcr.io/openhands/agent-server:c212367-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-slim-amd64
ghcr.io/openhands/agent-server:c212367-python-slim-arm64
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-python-slim-arm64
ghcr.io/openhands/agent-server:acp-hermes-provider-python-slim-arm64
ghcr.io/openhands/agent-server:c212367-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-slim-arm64
ghcr.io/openhands/agent-server:c212367-golang
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-golang
ghcr.io/openhands/agent-server:acp-hermes-provider-golang
ghcr.io/openhands/agent-server:c212367-golang_tag_1.21-bookworm
ghcr.io/openhands/agent-server:c212367-java
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-java
ghcr.io/openhands/agent-server:acp-hermes-provider-java
ghcr.io/openhands/agent-server:c212367-eclipse-temurin_tag_17-jdk
ghcr.io/openhands/agent-server:c212367-python-slim
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-python-slim
ghcr.io/openhands/agent-server:acp-hermes-provider-python-slim
ghcr.io/openhands/agent-server:c212367-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim-slim
ghcr.io/openhands/agent-server:c212367-python
ghcr.io/openhands/agent-server:c212367c6baa7c22cfa142e0d236508a78a459fc-python
ghcr.io/openhands/agent-server:acp-hermes-provider-python
ghcr.io/openhands/agent-server:c212367-nikolaik_s_python-nodejs_tag_python3.13-nodejs22-slim

About Multi-Architecture Support

  • Each variant tag (e.g., c212367-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., c212367-python-amd64) are also available if needed

Jev-Fast-Audit

⚡ Jev fast audit · estimates · 0.59s · commit c212367
Strongest signal: Unverified remote execution · 63% estimated likelihood.
Evidence: F004H008 · openhands-sdk/openhands/sdk/agent/acp_agent.py:2677–2969.
Coverage: ⚠️ reduced context — partial coverage; 20/59 hunks, 8/14 files (context budget: 20, file budget: 6, hunk budget: 39).

All estimates and evidence
Estimate Likelihood / value Direct evidence
SQL injection 3.0% No direct hunk selected
Command injection 15.0% F004H008 · openhands-sdk/openhands/sdk/agent/acp_agent.py:2677–2969
Weakened authentication 12.0% No direct hunk selected
Weakened authorization 14.0% No direct hunk selected
Contract regression 27.0% F003H002 · openhands-agent-server/openhands/agent_server/docker/build.py:454–472
Data loss 25.0% F004H008 · openhands-sdk/openhands/sdk/agent/acp_agent.py:2677–2969
Sensitive data disclosure 11.0% No direct hunk selected
Unexpected data transfer 8.0% No direct hunk selected
Credential misuse 15.0% No direct hunk selected
Untrusted instruction authority 7.0% No direct hunk selected
Package source redirection 11.0% No direct hunk selected
Unverified remote execution 63.0% F004H008 · openhands-sdk/openhands/sdk/agent/acp_agent.py:2677–2969
Privileged environment access 18.0% No direct hunk selected
Security assessment bypass 15.0% No direct hunk selected
Prohibited workload 3.0% No direct hunk selected
Primary concern Unverified remote execution; confidence 72.0% F004H008 · openhands-sdk/openhands/sdk/agent/acp_agent.py:2677–2969

… git checkout

Closes #4634.

Hermes cannot be launched the way the issue specifies. `uvx --from
git+<url>@<tag>` fails for three independent reasons, each verified against
v2026.8.31:

1. `setup.py` overrides `bdist_wheel`/`sdist` to raise outside a Nix build,
   so every PEP 517 path — uvx, `uv tool install`, pip — is blocked by
   design.
2. The guard protects something real: `[tool.setuptools.packages.find]`
   never packaged `skills/`, `locales/` or `optional-mcps/`, so a wheel
   forced through with HERMES_NIX_BUILD=1 runs while silently missing the
   skills system.
3. uv resolves the ref then re-fetches by commit SHA, which does not
   complete against a repository advertising 105,697 refs. Unfiltered
   `ls-remote` takes 438s here vs 8s with a ref-prefix; the fetch aborts at
   "expected flush after ref listing". Upstream's own installer documents
   the same GitHub throttle.

So the catalog grows a third flavour, ACPGitCheckoutInstallSpec, rendering
what upstream's installer does: a shallow single-branch clone of the tag
(one ref prefix, not the full advertisement) plus `uv sync --frozen --extra
acp`, whose editable install the wheel guard explicitly permits.

default_command is the bare console script. ACPAgent materialises the
checkout under the conversation's durable cache root, keyed by pin, and
prepends its venv bin to the subprocess PATH. Nothing reaches the published
images: render_docker_install_plan rejects the flavour, so
INSTALL_ACP_PROVIDERS=hermes fails the build with a clear message instead of
handing a git URL to `npm install -g`.

`uv sync` writes the venv's absolute path into every console script shebang,
so the install has to run in place; only the clone stages and renames, and a
marker file rather than directory existence is the ready signal.

Registry values are read off a live hermes-acp, not assumed: agentInfo.name
is `hermes-agent` and its version `0.21.0` — not the CalVer tag, hence
`reported_version` to keep the drift check meaningful; modes are
default/accept_edits/dont_ask with `dont_ask` the one that clears prompts;
model selection rides session/set_model with no configOptions; ids are
`<hermes-provider>:<model>` and follow the credential, so nothing is
curated. OPENAI_API_KEY + OPENAI_BASE_URL resolve its `openai-api` provider,
which is what routes it at a LiteLLM proxy.

Measured through ACPAgent, fully cold: 29.9s install + first session, 1.8s
warm, 434MB checkout, image size unchanged. Cold install runs under its own
budget rather than acp_startup_timeout because it is bandwidth-dominated.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xcUBSCfDEUysWgHYGkHY6
@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor
  ✅ **PR Artifacts Cleaned Up**

  The `.pr/` directory is no longer present.

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Python API breakage checks — ❌ FAILED

Result: ❌ FAILED

⚠️ Breaking API changes or policy violations detected.

Log excerpt (first 1000 characters)

============================================================
Checking openhands-sdk (openhands.sdk)
============================================================
Comparing openhands-sdk 1.47.0 against 1.47.0
::warning file=/home/runner/.cache/griffe/openhands-sdk==1.47.0/openhands/sdk/llm/llm.py,line=0,title=fy_params::Public object was removed
::error title=SemVer::Breaking changes detected (1); require at least minor version bump from 1.47.x, but new is 1.47.0

============================================================
Checking openhands-workspace (openhands.workspace)
============================================================
Comparing openhands-workspace 1.47.0 against 1.47.0
No breaking changes detected

============================================================
Checking openhands-tools (openhands.tools)
============================================================
Comparing openhands-tools 1.47.0 against 1.47.0
No breaking changes detected

Action log

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

REST API breakage checks (OpenAPI) — ✅ PASSED

Result: ✅ PASSED

Action log

@github-actions

github-actions Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-agent-server/openhands/agent_server/docker
   build.py58513078%101, 104–105, 119, 124, 128–130, 134, 139, 156–161, 164, 187, 189, 197, 199–200, 202–206, 208, 212, 215, 218–221, 223–225, 227, 229, 231, 233, 250, 349–350, 354–355, 359–360, 364–365, 378, 380–388, 509, 523, 529–530, 548, 554, 574–575, 577, 651, 665, 668, 672–673, 677–678, 682, 698–700, 703, 709–712, 722, 737, 758, 788, 807–808, 812–814, 868, 979, 989–990, 1173–1175, 1179–1180, 1183, 1200–1205, 1207–1208, 1210–1212, 1215–1216, 1221, 1225, 1271–1273, 1275–1276, 1278–1282, 1295
openhands-sdk/openhands/sdk/agent
   acp_agent.py180616191%364–365, 514–515, 542, 623, 625, 627, 672, 842, 848, 931, 971, 1190–1192, 1249–1250, 1330, 1350, 1581–1582, 1631, 1633, 1637, 1641, 1664, 1727–1728, 1733, 1800, 1989, 2097, 2109, 2122, 2190, 2193–2194, 2211–2212, 2228, 2245, 2250, 2358, 2363, 2412–2413, 2415, 2667–2670, 2675, 2709–2712, 2754, 2830, 2833–2834, 3106, 3202, 3228–3229, 3245–3246, 3289–3290, 3555–3556, 3560–3562, 3565–3570, 3574–3576, 3580, 3584–3585, 3588–3589, 3592, 3874, 3889–3890, 3893–3895, 3903, 3907, 3911–3912, 3918–3919, 3931–3932, 3935, 3983, 3988–3990, 3994–3995, 4027, 4064–4065, 4116, 4339–4341, 4344–4345, 4404, 4586, 4594–4596, 4639–4640, 4643, 4651–4655, 4662, 4664, 4668, 4671, 4680–4684, 4691, 4727–4728, 4746–4749, 4752, 4756–4758, 4760, 4764–4765, 5034–5035, 5048–5049, 5105–5106
openhands-sdk/openhands/sdk/settings
   acp_install_catalog.py128298%239, 505
   model.py8146992%313, 331, 540, 557, 567–570, 573, 586, 590, 596, 606, 612, 617, 733, 736–737, 743–746, 751, 755, 770, 773–775, 823, 828–829, 834, 855, 867, 916, 925, 972, 1160, 1185, 1187, 1189, 1191, 1193, 1195, 1197, 1199, 1201, 1203, 1476, 1478, 1780, 1800, 1937, 2066, 2105, 2260–2262, 2264, 2350, 2360, 2362, 2367, 2385, 2398, 2400, 2402, 2404, 2411
TOTAL43166787282% 

@simonrosenberg
simonrosenberg marked this pull request as ready for review September 5, 2026 14:55
@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: 41ff0343528590350362e098f0c038da5a45d9cc
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/177bf355-65d5-433b-9f93-7d600c72048f

This comment was posted by an AI agent (OpenHands).

@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.

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

🟡 Acceptable — well-structured addition with a clean install-flavour abstraction and good test coverage. The mechanism (shallow clone + uv sync in place, marker file for completion, keyed-by-pin cache) is sound. Two concerns below, plus an eval-risk flag.

Concerns

1. Concurrent uv sync race on a cold cache

_prepare_git_checkout handles the clone race correctly (staging dir + atomic rename + OSError catch), but the uv sync step at the end runs unconditionally on the shared checkout_dir. When two conversations start simultaneously with a cold cache for the same git-checkout provider:

  • Both see no marker file → both call _prepare_git_checkout
  • One wins the clone race (rename succeeds), the other loses (rename fails, keeps the winner's tree)
  • Both then run uv sync on the same checkout_dir concurrently
  • Both write the ready marker afterward

Two concurrent uv sync processes modifying the same venv is not guaranteed safe — if they corrupt each other's state, the marker file still gets written, leaving a broken venv marked as complete. The next launch would skip the install entirely.

Worth considering a file lock (e.g. fcntl.flock on a lockfile beside the marker) or a per-pin lock to serialize the sync step across conversations.

2. requires_python is recorded but never enforced

ACPGitCheckoutInstallSpec.requires_python is set to ">=3.11,<3.14" for Hermes, and the docstring says it's recorded "for the same reason min_node_version is." But unlike min_node_version (which has a floor check in _skip_if_node_below_floor and test_agent_server_node_pin_clears_every_declared_engine_floor), requires_python is never checked anywhere — not at install time, not in conformance tests, not in any unit test. If the host Python doesn't satisfy the constraint, uv sync will fail with a deep dependency-build error rather than a legible version message, which is exactly what the docstring says it's trying to prevent. Consider either adding a check or dropping the field until it's wired up.

Eval Risk

This PR changes ACP agent launch behavior (new provider, new install mechanism in _start_acp_server, changes to _log_acp_provider_version). Per the repo review policy, changes that could plausibly affect benchmark/evaluation performance should not be approved without eval evidence. No eval monitor link or human maintainer confirmation is present in the PR. Flagging for a human maintainer to decide after running lightweight evals.

Risk Assessment

  • Overall PR: 🟡 MEDIUM — New install mechanism is well-isolated (only activates for git-checkout providers, hardcoded URL, no user input in commands), but the concurrent sync race and the eval-risk category warrant attention before merge.

Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:

  1. Add a .agents/skills/custom-codereview-guide.md file to your branch (or edit it if one already exists) with the /codereview trigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.
  2. Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
  3. When your PR is merged, the guideline file goes through normal code review by repository maintainers.

Resolve with AI? Install the iterate skill in your agent and run /iterate to automatically drive this PR through CI, review, and QA until it's merge-ready.

Was this review helpful? React with 👍 or 👎 to give feedback.

Serialise the git-checkout install across conversations. Staging the clone
made it crash-safe but not concurrent: two conversations starting together
both reached `uv sync` on one venv and both wrote the ready marker, so a pair
of syncs that trod on each other would leave a broken venv flagged complete.
An advisory lock now spans the whole install, with the marker re-checked
inside it since the OS drops the lock if its holder dies. `fcntl` is imported
lazily so non-POSIX platforms degrade to the unserialised path rather than
failing to launch.

Drop `requires_python`. It claimed to make a violated floor legible the way
`min_node_version` does, but nothing read it — `uv` resolves the interpreter
from the project's own `requires-python` and downloads one if needed, so the
floor is the installer's to enforce and restating it here only invited drift.

Point `UV_PYTHON_INSTALL_DIR` at the durable cache. An interpreter uv
provisions otherwise lands under the user's home, where container replacement
takes it — along with the venv that symlinks into it, leaving a checkout whose
marker still says ready.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xcUBSCfDEUysWgHYGkHY6
@simonrosenberg

Copy link
Copy Markdown
Member Author

Addressed both concerns in db5ba3c.

1. Concurrent uv sync race — fixed, and you were right about the failure mode. An advisory lock (fcntl.flock) now spans the whole install, with the ready marker re-checked inside the lock since the OS drops it if the holder dies. fcntl is imported lazily so non-POSIX platforms degrade to the unserialised path rather than failing to launch — the images this guards are Linux, and refusing to start a provider there would be the worse failure.

The regression test is sensitive to the fix rather than merely passing with it: with the lock neutered it reports 3 overlapping install steps, with it 1 (test_concurrent_installs_are_serialised_and_run_once).

2. requires_python — dropped. You're right that the docstring wrote a cheque the code didn't cash. I went with removal rather than a check, because uv reads the project's own requires-python and selects (or downloads) a matching interpreter, so the floor is the installer's to enforce; restating it in the catalog only invited drift. sync_command's docstring now says why there's deliberately no counterpart to min_node_version.

Chasing that down surfaced a related gap you didn't flag: an interpreter uv provisions lands under the user's home, not the durable cache — so container replacement would take it and the venv that symlinks into it, leaving a checkout whose marker still says ready. UV_PYTHON_INSTALL_DIR now points at the same durable root.

Eval risk — agreed this needs a human maintainer, not me; flagged to the PR author. Worth noting for whoever picks it up that the new install path is inert for every existing provider: it only activates when _git_checkout_spec matches, which today is Hermes alone, and Hermes is not in DEFAULT_PREINSTALLED_ACP_PROVIDERS or any eval agent-type list. The _log_acp_provider_version change is log-text only.

Re-verified after the change: test_acp_conformance_probe[hermes] passes live (42.5s), 779 unit tests green.

@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: db5ba3c81537fdbdfbf6749ec0fa2697ad7ffc3e
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/5e2acf93-63f9-48d7-a10c-f8a4595ed510

This comment was posted by an AI agent (OpenHands).

@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.

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

Summary

This PR adds Hermes as a built-in ACP provider via a third install flavour — a shallow git checkout + uv sync --frozen — because Hermes blocks wheel builds by design and uv's git backend can't complete against its ~10^5-ref repository. The mechanism is well-reasoned, the code is clean, and the test coverage is thorough (concurrency serialization, crash recovery, pin keying, in-place install invariant, version mismatch detection).

Assessment

Good taste — The design solves a real constraint without over-engineering. The ACPGitCheckoutInstallSpec is a clean parallel to ACPInstallSpec, the is_npm_spec/is_git_checkout_spec TypeGuards keep consumers type-safe, and the Docker rejection path ensures Hermes adds zero weight to published images.

No blocking issues found. One observation worth noting:

Env exposure to install subprocesses

The env dict assembled at _start_acp_server (containing all conversation secrets — API keys, credentials) is passed through _acp_git_checkout_bin -> _prepare_git_checkout -> _run_checkout_step -> create_subprocess_exec, so git clone and uv sync run with the full secret set in their environment. This is consistent with the existing npx cache-warm pattern (which also passes the full env), and uv sync --frozen uses the locked deps without arbitrary resolution. The editable install does run Hermes' own build backend at the pinned tag, so the trust surface is Hermes' setup.py at v2026.8.31 — a reviewed, pinned ref from a known org. Not blocking, but worth being aware of: if a future provider's build backend is less trusted, consider stripping secrets before the install steps.

Eval validation

The PR provides strong evidence (live conformance probe, e2e test through the eval LiteLLM proxy), but no eval monitor link. Since this PR doesn't change behavior for existing providers (the git-checkout path only activates for hermes, and the _log_acp_provider_version refactor preserves the same pinned-version value for npm providers), the eval-risk to existing benchmarks is minimal. The new provider itself should be eval-validated before being used in benchmark comparisons — the PR description acknowledges this is deliberately out of scope.

Risk Assessment

  • Overall PR: LOW
    • No existing provider behavior is altered
    • Hermes is opt-in (not in DEFAULT_PREINSTALLED_ACP_PROVIDERS)
    • Docker build rejection prevents image bloat
    • Cross-process locking + marker recheck handles concurrency correctly
    • Supply chain: pinned git tag from NousResearch, --frozen lockfile, reported_version catches moved tags

Verdict

Worth merging. The mechanism is sound, well-tested, and the constraints that forced the git-checkout approach (wheel guard, ref advertisement throttle) are real and well-documented.

The ACP server is a black box that needs credentials delivered upfront, so
the subprocess gets the whole secret registry. `git clone` and `uv sync` are
not that: they need none of it, and the editable install runs the pinned
project's own build backend — third-party code with no business seeing the
user's keys.

The install steps now get the same environment minus the registry's values.
Targeted rather than a wipe: PATH, the relocated data dir and the uv cache
overrides all still reach them.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xcUBSCfDEUysWgHYGkHY6
@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: f0eb7e940c9aec238494796c3aa0f243e653c180
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/c5877f34-3086-4be3-a0c2-1d02ad9876e2

This comment was posted by an AI agent (OpenHands).

all-hands-bot
all-hands-bot previously approved these changes Sep 5, 2026

@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.

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

Summary

This PR adds Hermes as a built-in ACP provider installed from a pinned git checkout (ACPGitCheckoutInstallSpec), a third install flavour alongside the existing npm-based ACPInstallSpec. The design is well-reasoned: Hermes blocks wheel builds by design, so uvx/pip install can'''t work, and a shallow single-branch clone + uv sync --frozen --extra acp is the path upstream supports.

The implementation is thorough — cross-process locking with double-checked marker files, staging-clone-then-rename for crash safety, secret stripping for the install subprocess, keyed-by-pin cache directories, and rejection from Docker image builds via render_docker_install_plan. Tests cover the concurrency, secret isolation, in-place install, and pin-keying properties.

Findings

One minor observation (not blocking):

Conformance test skip condition (tests/sdk/agent/test_acp_conformance.py, line 226): The @requires_npx decorator is applied at the function level, so the entire parametrized test (including the hermes case) is skipped when npx is unavailable. Hermes doesn'''t need npx — it needs git and uv, which _skip_unless_installable already checks. On a host with git+uv but no Node.js, the Hermes conformance probe would be skipped unnecessarily. This is harmless in CI (where both are present) but slightly inconsistent with the per-flavour skip logic that was carefully added.

Risk Assessment

🟢 LOW — This is an additive change: a new opt-in ACP provider not in the default preinstalled list. The new code path in _start_acp_server (git-checkout install) is guarded by _git_checkout_spec(provider.key) is not None, which returns None for all existing npm providers, so existing provider behavior is unaffected. No version bumps in pyproject.toml, no dependency changes, no event type modifications. The TypeScript mirror and drift check are consistent. The PR description includes live conformance and end-to-end eval evidence.

Verdict: ✅ Worth merging. Clean design, good test coverage, no material issues.

@all-hands-bot
all-hands-bot dismissed their stale review September 5, 2026 16:02

Automated review used the wrong decision (APPROVED instead of COMMENT) and is dismissed. Findings are reposted as a comment.

@all-hands-bot

all-hands-bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

🚦 CI is currently failing on this PR's latest commit.

Please fix the failing checks before OpenHands reviews it - this is re-checked automatically once you push a new commit. (A maintainer can also request @all-hands-bot as a reviewer to have it reviewed regardless of CI status.)

This is an automated check - no AI was used to generate this comment.

Not for merge. sdk-tests is green at 41ff034 (reconfirmed by rerun) and red
on every SHA after it, always the same 5 MCP tests. This splits the cause
between the tests I added and the source change they exercise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: 8601cd52716e682150ce8aba42262ec81935363a
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/036f83ef-cfff-46b4-b860-c19e2bd154f6

This comment was posted by an AI agent (OpenHands).

@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.

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

The core implementation is solid — the third install flavour (shallow clone + uv sync in place, marker-file completion, keyed-by-pin cache, fcntl serialization, secret stripping) is well-reasoned and the abstraction across ACPInstallSpec / ACPGitCheckoutInstallSpec is clean. However, the head commit is not in a mergeable state.

Blocking concern: temporary bisect commit on HEAD

The head SHA (8601cd52) is commit tmp: CI bisect — skip the 3 tests added since 41ff0343, with the message explicitly stating "Not for merge." It marks three tests with @pytest.mark.skip("CI bisect"):

  • test_concurrent_installs_are_serialised_and_run_once — verifies cross-conversation install locking
  • test_lock_is_rechecked_so_a_dead_holder_does_not_strand_the_install — verifies lock release
  • test_install_steps_do_not_receive_conversation_secrets — security-relevant: verifies that conversation secrets (CUSTOMER_API_KEY) are stripped from the env passed to git clone / uv sync

The secret-stripping test is the one that validates the defense-in-depth property the PR description calls out as deliberate. Shipping the code without its verification test active is a real gap. This commit needs to be dropped (or the bisect resolved and the skips removed) before merge.

Minor: inaccurate uvx comment

The inline comment on the Hermes registry entry says A ``uvx`` command, not ``npx``` — but launch_command()returns("hermes-acp",), a bare console script, not a uvxinvocation. The PR description and theACPGitCheckoutInstallSpec.launch_command()docstring both correctly describe it as a console script resolved offPATH`. The comment appears to be left over from an earlier design iteration and is misleading.

Risk Assessment

🟡 MEDIUM — The implementation itself is low-risk (additive, existing providers unaffected, no version bumps, no event type changes). The elevated risk is solely due to the non-mergeable bisect commit on HEAD with skipped tests, one of which guards a security property.

Recommendation: Do not merge until the bisect commit is dropped and all three tests are re-enabled (or the CI failure is otherwise resolved). Once that's done, this is ready to go.

Comment thread tests/sdk/agent/test_acp_agent.py Resolved
simonrosenberg and others added 2 commits September 6, 2026 12:20
Reverts the bisect skips and fixes what they located.

`test_concurrent_installs_are_serialised_and_run_once` entered
`patch("...acp_agent.asyncio.create_subprocess_exec")` from each of its three
threads. That swaps an attribute on the real `asyncio` module, so overlapping
enter/exit restores in the wrong order and leaves the stub installed
*process-wide* — after which every real subprocess the worker spawns gets a
MagicMock. In CI that surfaced ~90s later and nowhere near the cause, as
`MCPError: MCP Connection Failure` in the MCP stdio client plus four fixture
setup errors, on every SHA since the test landed.

Reproduced locally at 1-in-5; CI's two vCPUs made the interleaving reliable.
The patch now wraps the whole thread lifecycle instead, and the test asserts
the stub is gone afterwards so the shape cannot silently regress.

Bisected against a rerun of sdk-tests at 41ff034, which stayed green
(6109 passed, 0 errors) while later SHAs failed — ruling out the runner and
the source change, and leaving only the tests.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xcUBSCfDEUysWgHYGkHY6
Left over from the uvx design that turned out to be impossible.
`launch_command()` returns a bare console script; the checkout is installed
before launch and its venv reaches the subprocess through PATH.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013xcUBSCfDEUysWgHYGkHY6
@simonrosenberg

Copy link
Copy Markdown
Member Author

Both points addressed — thanks, the second one was a real leftover.

Blocking concern (bisect commit) — resolved in 90639d9, before this review landed. 8601cd52 was a deliberate CI bisect, and you're right that it was not mergeable; it existed to localise a failure I'd twice misclassified as flaky. All three tests are re-enabled, including the secret-stripping one.

What it found, since it's the kind of thing worth recording: test_concurrent_installs_are_serialised_and_run_once entered patch("...acp_agent.asyncio.create_subprocess_exec") from each of its three threads. That swaps an attribute on the real asyncio module, so overlapping enter/exit restores in the wrong order and leaves the stub installed process-wide — after which every real subprocess in that xdist worker got a MagicMock. It surfaced ~90s later in an unrelated file as MCPError: MCP Connection Failure plus four MCP fixture setup errors. Reproduced locally at 1-in-5; CI's two vCPUs made the interleaving reliable. The patch now wraps the whole thread lifecycle and the test asserts the stub is gone afterwards.

The control that settled it: rerunning sdk-tests at 41ff0343 after the failures began stayed green (6109 passed, 0 errors), ruling out the runner; the bisect then ruled out the source change.

Stale uvx comment — correct, and a genuine leftover from the design that turned out to be impossible. Fixed in a5d0538: it now says the command is a bare console script whose venv reaches the subprocess through PATH, matching launch_command() and the docstring.

Head is now a5d0538.

@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: a5d0538dd2d189bc40cb657f00491557fc67f842
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/cb7154bb-d56b-468e-94c8-2b7766987a93

This comment was posted by an AI agent (OpenHands).

@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: 05716626cfc20f07dfce6fd395dc35537ab6d066
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/9381f47a-314d-49f0-b60d-147e3a1fe955

This comment was posted by an AI agent (OpenHands).

@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.

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

🟡 Acceptable — the install-flavour abstraction, locking, crash recovery, and secret stripping are thoughtfully implemented, but the built-in does not yet reliably execute the reviewed Hermes source.

Two important pinning issues are called out inline. Both undermine the core promise of this PR: a mutable tag can change before first install, and an ambient hermes-acp can bypass checkout installation entirely.

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🔴 HIGH. This adds runtime download and execution of a third-party build/backend that subsequently runs with conversation credentials. Until source identity is immutable and ambient binaries cannot bypass it, do not auto-merge; a human maintainer should validate the corrected supply-chain boundary.

VERDICT:
❌ Needs rework: Make the reviewed commit identity enforceable and always launch the checkout-managed binary.

KEY INSIGHT:
A pinned install mechanism must bind both the downloaded source and the launched executable to the catalog entry.

Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:

  1. Add a .agents/skills/custom-codereview-guide.md file to your branch (or edit it if one already exists) with the /codereview trigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.
  2. Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
  3. When your PR is merged, the guideline file goes through normal code review by repository maintainers.

Resolve with AI? Install the iterate skill in your agent and run /iterate to automatically drive this PR through CI, review, and QA until it's merge-ready.

Was this review helpful? React with 👍 or 👎 to give feedback.

…t an ambient binary stand in for it

Two gaps in the git-checkout install flavour, both from the #4864 review:

- The pin was a tag, and a tag can be moved. `uv sync` runs the checkout's
  own build backend and its CLI then runs with conversation credentials, so
  record the reviewed commit in the catalog and refuse to install a tree
  whose HEAD is not it. The commit joins the pin identity, so a cache entry
  can never be reused as the reviewed one after a bump.
- `shutil.which(command)` consulted the *parent's* PATH, so any preinstalled
  `hermes-acp` skipped the install and got launched unverified. Drop that
  gate: a completed install costs one stat, and prepending the venv is what
  makes the child exec ours. Only an explicitly-pathed command stays exempt,
  where PATH plays no part in what runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: b3b8f5556398a4c3fdd29ce02b43406a08aacf18
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/92116fbf-11f0-4c76-b6b2-34a2f6c2e4fa

This comment was posted by an AI agent (OpenHands).

@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.

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

🟡 Acceptable — the commit pin and ambient-binary fixes correctly close the previously reported supply-chain gaps. One portability bug remains in the new checkout launcher.

This adds a new ACP harness and runtime install path, so despite the targeted conformance and end-to-end evidence, a human maintainer should make the final benchmark/eval-risk decision; there is no completed eval-monitor run plus human confirmation in the PR discussion.

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟡 MEDIUM. The Linux path is carefully pinned, serialized, and secret-stripped, but the built-in currently cannot launch on a supported Windows SDK/server installation.

VERDICT:
❌ Needs rework: Use the platform-specific virtual-environment scripts directory and cover it in the Windows test path.

KEY INSIGHT:
The checkout is portable, but its executable lookup path must follow the host virtual-environment layout.

Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:

  1. Add a .agents/skills/custom-codereview-guide.md file to your branch (or edit it if one already exists) with the /codereview trigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.
  2. Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
  3. When your PR is merged, the guideline file goes through normal code review by repository maintainers.

Resolve with AI? Install the iterate skill in your agent and run /iterate to automatically drive this PR through CI, review, and QA until it is merge-ready.

Was this review helpful? React with 👍 or 👎 to give feedback.

simonrosenberg and others added 2 commits September 8, 2026 19:22
…stall

GitHub meters a repository whose ref advertisement runs to ~10^5 refs and
answers a burst with HTTP 429, which git reports as a failed RPC rather than
retrying itself — upstream's own installer works around the same throttle.
A single one of those was enough to leave the provider unusable until the
next launch, and it took out acp-live-tests on two consecutive runs.

Bounded retries with doubling backoff, sharing one deadline so the phase
stays inside the budget the caller's timeout is sized against. Partial trees
are cleared between attempts, since `git clone` refuses an existing
destination. Reading a checkout's HEAD back gets its own local-read budget
rather than the transfer one.

Validated against the live throttle: attempt 1 took a real 429, attempt 2
cloned, and HEAD verified against the pinned commit.

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

Copy link
Copy Markdown
Member Author

Pushed dc5c34cb6 (merged with main as f533e2844): bounded retry with doubling backoff on the clone step.

acp-live-tests went red on the last two runs for a reason outside this PR — GitHub is metering NousResearch/hermes-agent:

error: RPC failed; HTTP 429 curl 22 The requested URL returned error: 429
fatal: expected flush after ref listing

While it was happening, that repo returned 429 on every access path — clone, contents API, and raw.githubusercontent — from both a local machine and the Blacksmith runners, while a control repo returned 200. It is the ~10^5-ref advertisement being expensive to serve, and it is the same throttle upstream's own installer retries around.

Losing a whole cold install to one of those is a real defect for users, not just CI noise, so the retry is in the PR rather than left to a rerun. The attempts share one deadline, so the phase stays inside the budget the caller's timeout is sized against, and a partial tree is cleared between attempts (git clone refuses an existing destination).

Validated against the live throttle rather than only stubs — attempt 1 took a real 429, attempt 2 cloned, and the result verified against the pinned commit:

WARNING ACP provider clone attempt 1/3 failed for hermes; retrying in 5s:
        ... remote: This request was rate-limited due to too many requests.
        ... error: 429
CLONE SUCCEEDED; HEAD=29112bef099274229cadff79cdff7bf7b99c4b77
pinned commit  =29112bef099274229cadff79cdff7bf7b99c4b77   MATCH

@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: f533e2844910827bab39600e1122b21cb72430cd
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/01a8be80-bbb9-498b-b55d-ae0476d94e4c

This comment was posted by an AI agent (OpenHands).

@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.

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

🟡 Acceptable — the newly added bounded clone retry is sound and its focused tests pass, but it does not address the existing Windows launch blocker.

Because this adds a new ACP harness/runtime install path and there is no completed eval-monitor run plus human confirmation in the discussion, a human maintainer should also make the final benchmark/eval-risk decision.

[RISK ASSESSMENT]

  • [Overall PR] ⚠️ Risk Assessment: 🟡 MEDIUM. The Linux install path is pinned, serialized, secret-stripped, and now resilient to transient clone throttling, but the built-in still cannot locate its installed console script on supported Windows installations.

VERDICT:
❌ Needs rework: Return the platform-specific virtual-environment scripts directory and cover the Windows branch.

KEY INSIGHT:
Retrying the clone improves cold-start reliability, but executable discovery must match uv's host-specific venv layout.

Improve this review? If any feedback above seems incorrect or irrelevant to this repository, you can teach the reviewer to do better:

  1. Add a .agents/skills/custom-codereview-guide.md file to your branch (or edit it if one already exists) with the /codereview trigger and the context the reviewer is missing (e.g., "Security concerns about X do not apply here because Y"). See the customization docs for the required frontmatter format.
  2. Re-request a review - the reviewer reads guidelines from the PR branch, so your changes take effect immediately.
  3. When your PR is merged, the guideline file goes through normal code review by repository maintainers.

Resolve with AI? Install the iterate skill in your agent and run /iterate to automatically drive this PR through CI, review, and QA until it is merge-ready.

Was this review helpful? React with 👍 or 👎 to give feedback.

`uv sync` follows the interpreter's own venv layout, so console scripts land
in `Scripts` on Windows and `bin` everywhere else. The launch command is a
bare name resolved off PATH, so prepending the wrong one left `hermes-acp`
unfindable after a clean install on Windows — a platform this flavour
otherwise presents itself as supporting, `_installation_lock` degrading
without `fcntl` included.

The test checks against sysconfig's own venv scheme rather than repeating
the ternary, so hard-coding either name fails on the platform it is wrong for.

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

Copy link
Copy Markdown
Member Author

Heads up for reviewers on the one red required check — agent-server-tests is failing from main, not from this PR:

tests/agent_server/test_auto_title_span_metadata.py::test_auto_title_llm_span_joins_the_conversation_trace
E   AssertionError: assert 'llm.gpt-4o' == 'conversation.generate_title'

Proof it is not this branch: it reproduces on a clean detached worktree at fc9646ad8 with none of these changes present, deterministically. main's own tip (56b016e7f) is red on the same test.

Mechanism: #4836 opens an llm.<model> span in telemetry (llm_call_span(f"llm.{self.model_name}")), which now sits between conversation.generate_title and the title LLM span. The test still asserts the old direct-parent relationship, so it is the assertion that is stale rather than the tracing. Worth a separate PR — this one cannot go green until it lands.

Everything else on 40f26f359 is green, including acp-live-tests (the 429 retry holds up in CI) and unresolved-review-threads.

@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: 433d74027abae49d44d7fe7d63d621676e6af996
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/bba19d58-9f57-4531-84c8-3958d046feb7

This comment was posted by an AI agent (OpenHands).

…lls on Windows

Both from the #4864 review.

The completion marker recorded that an install finished, not that what it
produced is still the reviewed source. The cache is shared across a sandbox's
conversations and writable by the same user their terminals run as, so an
earlier conversation could edit the tree and a later launch would execute it
with that conversation's credentials. The identity check now runs before every
launch, not just at install: HEAD must be the pinned commit, and tracked files
must match the state recorded at install time. A launch that lost the install
race verifies too, rather than inheriting the winner's tree unchecked. Measured
at 0.05s on a warm checkout.

The baseline is compared rather than required to be empty because a pristine
checkout is not necessarily a quiet one: Hermes carries two paths differing
only in case (contributors/emails/agent@{A,a}gents-Mac-mini.local) which
collide on any case-insensitive filesystem, leaving one permanently "modified"
on macOS and Windows. `git diff --quiet HEAD` was tried first and fails on a
freshly cloned tree on both.

Install serialisation was a no-op wherever fcntl is absent, which this PR made
reachable by supporting the Windows venv layout: two conversations could run
`uv sync` on one venv and both flag it complete. Windows now takes an msvcrt
lock, polled because LK_LOCK gives up after ~10s while the work runs for
minutes. Only an interpreter with neither primitive proceeds unserialised, and
it says so.

Validated end-to-end against the real upstream repo: cold install, warm
re-verified launch, a poisoned tracked file refused, and the restored tree
launching again.

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

Copy link
Copy Markdown
Member Author

Both critical findings addressed in 01f1e18ac.

1. Shared writable executable cache

Fixed the actionable half: the marker fast path no longer trusts itself. _verify_checkout_identity now runs before every launch, not just at install — HEAD must be the pinned commit, and tracked files must match the state recorded at install time. A conversation that lost the install race also verifies rather than inheriting the winner's tree unchecked. Cost on a warm checkout, measured: 0.05s.

Getting this right needed a real install rather than unit stubs. My first attempt used git diff --quiet HEAD and it fails on a freshly cloned tree, before anything is installed:

git diff --quiet    = exit 1 (DIRTY)
 M contributors/emails/agent@Agents-Mac-mini.local

Hermes carries two paths differing only in case — contributors/emails/agent@{A,a}gents-Mac-mini.local — which collide on any case-insensitive filesystem. Requiring a quiet tree would have made the provider unlaunchable on macOS and on Windows, i.e. the platform finding 2 asks me to support. So the check compares against a baseline captured at install time instead. Verified uv sync does not perturb tracked files, so the baseline is stable.

End-to-end against the real upstream repo: cold install ✅, warm re-verified launch ✅ (0.05s), poisoned tracked file refused ✅, restored tree launches again ✅ (not sticky).

One correction to the framing, offered as evidence rather than disagreement: the shared-writable-cache property is not introduced by this PR and is not specific to Hermes. _acp_package_cache_dir is the same root for npm-cache, uv-cache and uv-python, and npx executes out of npm-cache — so conversation A can already poison code that conversation B's claude-code/codex/gemini/kimi/pi launch executes with B's credentials. That shipped before this branch. Same-uid is the actual boundary: the ACP subprocess and the agent's own terminal run as one user, so no filesystem location here is protected from a conversation that can already run code as that user.

What this PR can honestly claim is that the Hermes path is now the only provider whose executable source is cryptographically pinned and re-verified per launch. The residual is real and I would rather name it than paper over it: the venv (.venv/**) is not covered by the git check, and there is a TOCTOU window between verification and exec. Closing those properly means either per-conversation venvs or a non-agent-writable cache root — a provider-wide change I would rather do as its own PR than smuggle into this one. Happy to file it if you agree.

2. No Windows install serialization

Fixed. _lock_exclusive takes fcntl.flock on POSIX and an msvcrt lock on Windows, polled with LK_NBLCK because LK_LOCK gives up after ~10s while the work it guards runs for minutes. Only an interpreter with neither primitive proceeds unserialised, and it logs a warning when it does.

Covered by tests: the Windows lock is taken and the poll loop retries; a never-released lock times out rather than hanging a launch; and the degrade path is exercised.


6161 sdk tests pass, pyright and ruff clean.

@all-hands-bot

Copy link
Copy Markdown
Collaborator

🤖 OpenHands is reviewing this PR.

Head commit: 01f1e18acac4b0cd5eb15dfb9e83c64ce5a6c3e5
View the conversation: https://oss-agent-canvas.ngrok.dev/conversations/798e2676-b54b-4342-923d-24f7ab62ef09

This comment was posted by an AI agent (OpenHands).

@all-hands-bot

Copy link
Copy Markdown
Collaborator

⚠️ OpenHands PR Reviewer encountered a problem at commit 01f1e18acac4 (status: error).

This comment was posted by an AI agent (OpenHands).

@all-hands-bot
all-hands-bot removed their request for review September 9, 2026 09:21

@enyst enyst 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.

🛠️ REQUEST_CHANGES · Risk: HIGH · c212367c6baa

OpenHands-Astra, helping Engel Nyst (@enyst). AI review.

The new installation path needs correctness fixes before its isolation guarantees are reliable.

  • [P1] Fix the installer environment target: When UV_PROJECT_ENVIRONMENT names an external virtualenv, installation can replace that environment's packages while marking the checkout's absent virtualenv ready. evidence

  • [P1] Reject modified source before reinstalling: When a cached checkout lacks a valid completion marker, modified source is accepted and executed as the pinned build. evidence

  • [P2] Launch the checkout executable explicitly: On native Windows, changing only the child's PATH does not select the installed executable, causing startup failure or ambient-binary execution. evidence

  • [P2] Exclude ambient credentials from installation: With environment-only API credentials, installation forwards those keys to third-party build subprocesses instead of withholding them. evidence

  • [P3] Scope conformance prerequisites by provider: Without npx or npm-registry access, the Hermes conformance probe skips despite having git and uv, unnecessarily losing live validation. evidence

Limits: Validation was source-only; reported live runs, native Windows behavior, and upstream release provenance were not independently verified.; Maintainer-confirmed benchmark evidence is unavailable; the reported proxy smoke run does not establish broader evaluation safety.

Changed after comparison: 1 finding added.

🤖 Real catches, material misses; the bot celebrated its self-dismissed approval. Historical policy remains unknown.

Receipts and review scores

Finding receipts

  • [P1] Fix the installer environment target:

    checkout_spec = (
    _git_checkout_spec(provider.key) if provider is not None else None
    )
    if checkout_spec is not None and not os.path.dirname(command):
    env["UV_CACHE_DIR"] = str(self._acp_package_cache_dir(state, "uv-cache"))
    # An interpreter uv provisions to satisfy the project's
    # ``requires-python`` otherwise lands under the user's home, where
    # container replacement takes it — and with it the venv that
    # symlinks into it, leaving a checkout whose marker says ready.
    env["UV_PYTHON_INSTALL_DIR"] = str(
    self._acp_package_cache_dir(state, "uv-python")
    )
    # Install with the conversation's credentials stripped. The ACP
    # server needs them; `git clone` and `uv sync` do not, and the
    # editable install runs the pinned project's own build backend —
    # third-party code that has no business seeing the user's keys.
    install_env = {
    key: value
    for key, value in env.items()
    if key not in conversation_secrets
    }
    bin_dir = self._acp_git_checkout_bin(state, checkout_spec, install_env)
    env["PATH"] = os.pathsep.join((str(bin_dir), env.get("PATH", os.defpath)))
    ·
    return ("git", "status", "--porcelain", "--untracked-files=no")
    def sync_command(self) -> tuple[str, ...]:
    """Editable install of the checkout, at its own locked versions.
    There is deliberately no ``requires_python`` counterpart to
    :attr:`ACPInstallSpec.min_node_version` here: ``uv`` reads the
    project's own ``requires-python`` and selects — or downloads — a
    matching interpreter, so the floor is enforced by the installer
    rather than by anything this catalog could restate.
    """
    extras = tuple(arg for extra in self.extras for arg in ("--extra", extra))
    return ("uv", "sync", "--frozen", *extras)
    ·
    tracked = await self._verify_checkout_identity(spec, checkout_dir, env)
    await self._run_checkout_step(
    spec.sync_command(), spec.key, env, str(checkout_dir)
    )
    (checkout_dir / _ACP_CHECKOUT_READY_FILE).write_text(
    json.dumps({"pin": spec.source.pinned, "tracked": tracked})
    )
    ·
    # NOTE: we should NOT include UV_PROJECT_ENVIRONMENT here,
    # since the agent might use it to perform other work (e.g. tools that use Python)
    COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /uvx /bin/

  • [P1] Reject modified source before reinstalling:

    tracked = await self._verify_checkout_identity(spec, checkout_dir, env)
    await self._run_checkout_step(
    spec.sync_command(), spec.key, env, str(checkout_dir)
    )
    (checkout_dir / _ACP_CHECKOUT_READY_FILE).write_text(
    json.dumps({"pin": spec.source.pinned, "tracked": tracked})
    )
    ·
    "was installed."
    )
    # rstrip only the trailing newline: porcelain's leading XY status
    # columns are part of what is being compared.
    tracked = (
    await self._run_checkout_step(
    spec.tracked_status_command(),
    spec.key,
    env,
    str(checkout_dir),
    timeout=_ACP_CHECKOUT_VERIFY_TIMEOUT,
    )
    ).rstrip("\n")
    if expected_tracked is not None and tracked != expected_tracked:
    raise RuntimeError(
    f"ACP provider checkout for {spec.key} was modified after it "
    f"was installed: tracked files under {checkout_dir} no longer "
    f"match the state recorded at install time.\n"
    f" recorded: {expected_tracked or '(clean)'}\n"
    f" now: {tracked or '(clean)'}\n"
    "Refusing to launch it with this conversation's credentials. "
    "Delete the directory to force a clean reinstall."
    )
    return tracked
    ·
    """
    return ("git", "rev-parse", "HEAD")
    def tracked_status_command(self) -> tuple[str, ...]:
    """Report how tracked files diverge from ``HEAD``, one line each.
    Blind to untracked files on purpose: an editable install leaves build
    artefacts in the tree, so their presence is expected and only a change
    to the reviewed content is not.
    Compared against a baseline captured at install time rather than
    required to be empty, because a clean checkout is not necessarily a
    quiet one — Hermes carries two paths differing only in case
    (``contributors/emails/agent@{A,a}gents-Mac-mini.local``) which collide
    on any case-insensitive filesystem, leaving one permanently "modified"
    on macOS and Windows.
    ·
    def test_a_checkout_that_is_never_quiet_is_still_launchable(self, tmp_path):

  • [P2] Launch the checkout executable explicitly:

    bin_dir = self._acp_git_checkout_bin(state, checkout_spec, install_env)
    env["PATH"] = os.pathsep.join((str(bin_dir), env.get("PATH", os.defpath)))
    ·
    process = await asyncio.create_subprocess_exec(
    command,
    *args,
    stdin=asyncio.subprocess.PIPE,
    stdout=asyncio.subprocess.PIPE,
    stderr=asyncio.subprocess.PIPE,
    env=env,
    limit=_STREAM_READER_LIMIT,
    )
    assert process.stdin is not None
    ·
    def test_ambient_binary_of_the_same_name_does_not_bypass_the_checkout(

  • [P2] Exclude ambient credentials from installation:

    # server needs them; `git clone` and `uv sync` do not, and the
    # editable install runs the pinned project's own build backend —
    # third-party code that has no business seeing the user's keys.
    install_env = {
    key: value
    for key, value in env.items()
    if key not in conversation_secrets
    }
    bin_dir = self._acp_git_checkout_bin(state, checkout_spec, install_env)
    ·
    env = default_environment()
    env.update(os.environ)
    _strip_inherited_npm_env(env)
    # Reserved file-content credential secrets (Codex auth.json, Gemini
    # Vertex SA — see _materialise_file_secrets) are written to disk, not
    # injected as env vars, so exclude their (large blob) names from the
    # plain env-injection below; materialisation sets only the path env var.
    file_secret_names = self._present_file_secret_names(state)
    # Inject the whole registry: an ACP CLI is a black box we can't
    # name-scan per command (unlike the regular agent's bash tool), so
    # credentials must be delivered upfront. Registry values override
    # ambient os.environ. Skip file secrets (materialised to disk below).
    conversation_secrets = state.secret_registry.get_all_secrets_as_env_vars(
    exclude=file_secret_names
    )
    env.update(conversation_secrets)
    ·
    def get_all_secrets_as_env_vars(
    self, exclude: Collection[str] | None = None
    ) -> dict[str, str]:
    """Resolve every registered secret to an env-var mapping.
    Unlike :meth:`get_secrets_as_env_vars`, which name-scans a single
    command and injects only the secrets it references, this resolves the
    whole registry. It is for opaque consumers (e.g. an ACP CLI subprocess)
    that cannot be name-scanned per command and must receive their
    credentials upfront. Resolved values are tracked for output masking, and
    lookup failures are skipped rather than raised.
    Note: this injects the *whole* registry; least-privilege scoping
    (provider creds + an explicit allowlist only) is deferred to #1039
    task 6.
    Args:
    exclude: Secret names to skip — e.g. keys a higher-precedence tier
    will set anyway, or file-content secrets materialised to disk
    (avoids a wasted, possibly remote, ``get_value()``).
    Returns:
    Dictionary of environment variables to export (key -> value),
    omitting empty values and excluded names.
    """
    skip = set(exclude or ())
    env_vars: dict[str, str] = {}
    for name in self.secret_sources:
    if name in skip:
    continue
    value = self.get_secret_value(name)
    if value:
    env_vars[name] = value
    return env_vars
    ·
    def test_install_steps_do_not_receive_conversation_secrets(self, tmp_path):

  • [P3] Scope conformance prerequisites by provider:

    @requires_npx
    @pytest.mark.parametrize("provider_key", list(ACP_PROVIDERS))
    def test_acp_conformance_probe(
    provider_key: str, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
    ) -> None:
    provider = ACP_PROVIDERS[provider_key]
    _skip_unless_installable(provider_key)
    _isolate_env(monkeypatch, tmp_path)
    ·
    def _npm_registry_reachable(timeout: float = 3.0) -> bool:
    try:
    socket.create_connection(("registry.npmjs.org", 443), timeout=timeout).close()
    return True
    except OSError:
    return False
    requires_npx = pytest.mark.skipif(
    shutil.which("npx") is None or not _npm_registry_reachable(),
    reason="npx (Node.js) not available, or npm registry unreachable",
    )
    def _skip_unless_installable(provider_key: str) -> None:
    """Skip when this provider's installer is not usable on the host.
    Each flavour has its own prerequisites, and a missing one is an unmet
    prerequisite rather than a conformance failure.
    """
    spec = ACP_INSTALL_CATALOG[provider_key]
    if is_npm_spec(spec):
    _skip_if_node_below_floor(provider_key)
    return
    missing = [tool for tool in ("git", "uv") if shutil.which(tool) is None]
    if missing:
    pytest.skip(
    f"provider {provider_key!r} installs from a git checkout; "
    f"missing {', '.join(missing)}"
    )
    · #4864 (review)

Assessment changes and counterevidence

  • Prior claim: The locked finding set omitted the Hermes conformance probe's unrelated npx prerequisite.

    The dismissed review identified a genuine, nonblocking testing defect. Independent reads at its reviewed commit and the current head confirm that the shared decorator skips Hermes when npx is absent or npm is unreachable, before the provider-specific git/uv checks execute. Add A5; preserve A1–A4, the action, risk, summary, reason, and existing limitations unchanged.

The supplied warm-cache correction and same-UID explanation do not refute A2: the locked finding already distinguishes source-pin enforcement from process isolation, and the current no-marker path still accepts arbitrary modified source as its baseline. The Scripts-directory correction likewise does not refute A3's separate native Windows executable-lookup problem. Preserved references to the blind stage describe the original assessment, not Stage B's evidence access.

@requires_npx
@pytest.mark.parametrize("provider_key", list(ACP_PROVIDERS))
def test_acp_conformance_probe(
provider_key: str, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
provider = ACP_PROVIDERS[provider_key]
_skip_unless_installable(provider_key)
_isolate_env(monkeypatch, tmp_path)
·
@requires_npx
@pytest.mark.parametrize("provider_key", list(ACP_PROVIDERS))
def test_acp_conformance_probe(
provider_key: str, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
provider = ACP_PROVIDERS[provider_key]
_skip_unless_installable(provider_key)
_isolate_env(monkeypatch, tmp_path)
· #4864 (review) ·
tracked = await self._verify_checkout_identity(spec, checkout_dir, env)
await self._run_checkout_step(
spec.sync_command(), spec.key, env, str(checkout_dir)
)
(checkout_dir / _ACP_CHECKOUT_READY_FILE).write_text(
json.dumps({"pin": spec.source.pinned, "tracked": tracked})
)
· #4864 (comment)

Reviews (17): 10 major misses · 7 supported

Reporting: ❌ 2 failed · 10 supported · 5 unknown.

Code: 0 material miss · 1 minor · 2 defensible · 3 supported · unscored: insufficient evidence. Policy and reporting are judged separately.

Review @ commit Code Policy Report Reason / receipt
5121748547 @ 41ff03435285 0 UNKNOWN PASS It noticed unsynchronized installation but missed the material ambient-binary pin bypass. Limits: Historical instructions and their delivery are unavailable; concurrency outcomes and upstream interpreter behavior were not executed. evidence
5121798392 @ db5ba3c81537 0 UNKNOWN PASS It identified credential forwarding but still accepted an ambient-binary pin bypass. Limits: Historical instructions and upstream release verification are unavailable; reported validation was not independently rerun. evidence
5121818894 @ f0eb7e940c9a 3 UNKNOWN UNKNOWN The correction accurately describes POSIX locking and the in-lock marker recheck. Limits: Score covers the stated POSIX source correction; reported measurements and historical instructions are unavailable. evidence
5121818968 @ f0eb7e940c9a 3 UNKNOWN PASS Registry-secret filtering was added as described without stripping the server environment. Limits: Historical instructions are unavailable; this validates the registry-scoped change, not ambient-secret isolation or executed tests. evidence
5121951708 @ f0eb7e940c9a 0 UNKNOWN UNKNOWN The conformance-skip catch was correct, but material executable and test races remained. Limits: Historical instructions and the claimed repost are unavailable; no test-race reproduction was executed. evidence
5123506016 @ 8601cd52716e 0 UNKNOWN PASS It correctly blocked disabled tests but missed the remaining ambient executable bypass. Limits: Historical instructions are unavailable; the assessment confirms skipped coverage, not an executed failure. evidence
5125048689 @ a5d0538dd2d1 3 UNKNOWN UNKNOWN The skips are removed and one patch now surrounds all worker threads. Limits: The claimed clean SDK run and historical instructions are unavailable; the source correction itself is supported. evidence
5125048757 @ a5d0538dd2d1 3 UNKNOWN PASS The registry comment now accurately describes the bare console-script launch command. Limits: Historical instructions are unavailable; the score covers the reported documentation correction only. evidence
5125052532 @ a5d0538dd2d1 0 UNKNOWN FAIL It declared the installer sound while ambient executables still bypassed the checkout. Limits: Historical instructions and delivery records are unavailable; the source miss and post-dismissal reporting are independently established. evidence
5125227511 @ 16b59e278c16 0 UNKNOWN FAIL Its no-findings conclusion overlooked the still-present ambient-binary bypass of managed installation. Limits: Historical instructions are unavailable; no assumption about the validity of a historical COMMENT-only rule is required. evidence
5141416013 @ 05716626cfc2 0 UNKNOWN PASS Both pinning catches are valid, but inherited uv settings can damage external environments. Limits: Historical instructions and upstream tag provenance are unavailable; the external-virtualenv failure was assessed from source, not executed. evidence
5144206205 @ dece0e15d98e 0 UNKNOWN UNKNOWN The HEAD check exists, but it does not prevent executing modified source. Limits: Historical instructions and the reported real-Git experiment are unavailable; the dirty-checkout counterexample is source-based. evidence
5144208079 @ dece0e15d98e 3 UNKNOWN PASS The ambient lookup gate is removed, with the explicit-path exemption preserved. Limits: Historical instructions are unavailable; this validates gate removal, not native executable selection or a passing test run. evidence
5144909279 @ b3b8f5556398 0 UNKNOWN PASS It caught the Windows directory error but missed execution of modified cached source. Limits: Historical instructions are unavailable; neither native Windows startup nor a modified-backend execution was run here. evidence
5144965211 @ f533e2844910 0 UNKNOWN UNKNOWN The repeated Windows catch is valid, but modified-checkout execution still went unreported. Limits: Historical instructions and evidence for the reviewer's claimed passing tests are unavailable; source assessment does not establish execution. evidence
5145112540 @ 40f26f359fd7 3 UNKNOWN PASS Both return sites use the platform directory, and the layout assertion matches sysconfig. Limits: Historical instructions are unavailable; the supported layout correction does not resolve the separate native Windows lookup defect. evidence
5145113565 @ 40f26f359fd7 3 UNKNOWN PASS The second reply correctly links the duplicate directory finding to the same fix. Limits: Historical instructions are unavailable; this confirms the duplicate finding's directory fix, not end-to-end Windows startup. evidence

Generated by OpenHands AI using openai/gpt-6-astra; reviewed #4864 at c212367c6baa7c22cfa142e0d236508a78a459fc.

@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.

This review was posted by an AI agent (OpenHands).

Scope: in-repo. openhands-sdk owns ACP launch behaviour and the install catalog, openhands-agent-server owns the Docker build surface, and clients/typescript/ is the required mirror. No ownership problem, no move/close recommendation. Per this repo's review policy this change is eval-adjacent (it adds an ACP harness and touches ACP launch paths), so I am not approving on my own; the PR also still carries an unresolved human CHANGES_REQUESTED review at this exact head and mergeStateStatus is BLOCKED.

I read the mechanism rather than only the diff: the shallow single-branch clone plus in-place uv sync --frozen --extra acp, the marker-file gate, the pin-keyed cache directory, the cross-process lock, and the commit-identity check before any of the tree executes. The design is sound and the reasoning in the catalog docstrings matches the code. Two things I could not leave unsaid are inline. I also confirmed the headline claim independently: render_docker_install_plan(["hermes"]) raises, and python3 -S .../acp_install_catalog.py hermes exits 1 with the "not npm-installable" message, so Hermes cannot reach a published image.

What I ran on this head (c212367c6baa):

uv run pytest tests/sdk/agent/test_acp_agent.py tests/sdk/settings/ \
  tests/cross/test_agent_server_build_metadata.py tests/sdk/test_settings.py
# 752 passed, 13 deselected

I verified the UV_PROJECT_ENVIRONMENT behaviour reported inline against uv directly (a --frozen sync into a pre-existing external venv installs the project there and writes the console script into that venv's bin/, leaving the checkout's .venv uncreated).

CI on the exact head. Python API (the Python API breakage checks workflow) is the one failing check. I confirmed it is not caused by this PR: the identical failure (Public object was removed in openhands/sdk/llm/llm.py, Comparing openhands-sdk 1.47.0 against 1.47.0) reproduces on 57f5cc9f4a, the main-side parent of this head's merge commit, where ACP_VERSION_CHECK_BASE_REF is that commit's own parent. So the check is red against main, not against these changes. That still leaves a required check red and the PR unmergeable, so it needs to be resolved (a main-side fix) before merge, even though nothing here needs to change for it.

Everything else on the head is green, including acp-live-tests (so the clone-retry path holds up in CI), windows-tests, sdk-tests, agent-server-tests, validate-acp-providers and unresolved-review-threads. The linked issue #4634 is still open with ready-for-dev and P0.

Non-blocking, for the record: the third install flavour is a genuine widening of the catalog's surface, and it is documented as such. The _installation_lock / _verify_checkout_identity pairing correctly treats the lock as liveness (not as evidence the work is unfinished) and re-verifies the tree on every launch, which is the right shape for a cache shared across a sandbox's conversations and writable by the same user their terminals run as.

🔄 CHANGES REQUESTED

for key, value in env.items()
if key not in conversation_secrets
}
bin_dir = self._acp_git_checkout_bin(state, checkout_spec, install_env)

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.

The install can target the wrong venv while the checkout's venv is marked ready.

env is built from os.environ (env.update(os.environ) above), and the strip here removes only keys that are conversation secrets. uv reads UV_PROJECT_ENVIRONMENT from that environment, so if it is already exported by whatever launched the agent-server, uv sync --frozen installs the pinned project into that path and never creates <checkout>/.venv — while this function still returns <checkout>/.venv/bin and _prepare_git_checkout still writes .openhands-acp-install-complete. Two consequences: the launch resolves hermes-acp from whatever is next on PATH (re-opening the ambient-binary bypass that always-prepending the venv exists to close), and a valid external environment is mutated with the pinned project.

I verified the uv behaviour directly, not from source:

$ UV_PROJECT_ENVIRONMENT=/tmp/external uv sync --frozen   # in a project
# installs projtest into /tmp/external, writes /tmp/external/bin/proj-acp,
# leaves the project's .venv uncreated

VIRTUAL_ENV is not equivalent — uv ignores it here and warns (does not match the project environment path .venv) unless --active is passed — so the fix only needs to pin the project environment. Note the shipped image is fine today (the builder stage's UV_PROJECT_ENVIRONMENT=/agent-server/.venv is not inherited by base-image-minimal, per the comment at Dockerfile:277), so this bites the SDK as a library and any custom base image rather than the default image.

Suggestion: set UV_PROJECT_ENVIRONMENT (or pass --project/--directory) for the install steps so the venv always lands at <checkout>/.venv, rather than relying on it being unset. This is the same area the existing review at this head flags — flagging it here with the reproduction so the fix is unambiguous.

(The same block already pins UV_CACHE_DIR and UV_PYTHON_INSTALL_DIR for exactly this kind of reason, which is why pinning the project environment too fits the existing shape.)

) -> None:
provider = ACP_PROVIDERS[provider_key]
_skip_if_node_below_floor(provider_key)
_skip_unless_installable(provider_key)

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.

The Hermes live probe is still gated on npm being present, so it can silently skip and never validate the git-checkout path.

test_acp_conformance_probe still carries @requires_npx (line 226), which is skipif(shutil.which("npx") is None or not _npm_registry_reachable()). _skip_unless_installable then branches per flavour and checks git/uv for the git-checkout case — but it only runs after the module-level decorator has already skipped. On any host with git and uv but no npx, or with registry.npmjs.org unreachable, the Hermes probe is reported as skipped rather than run, so the conformance coverage the PR description relies on (uv run pytest tests/sdk/agent/test_acp_conformance.py -m acp_live -k hermes) can evaporate without the CI signal changing from green.

Since _skip_unless_installable now exists precisely to make prerequisites per-flavour, the npm gate should move into it for the npm branch (e.g. skip when is_npm_spec(spec) and (npx missing or registry unreachable)) and the module-level requires_npx should go, so a git-checkout provider is gated on git/uv alone.

@simonrosenberg

Copy link
Copy Markdown
Member Author

Not planning on adding Hermes right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Harness Watch] Add Hermes through the existing ACP path

3 participants