Skip to content

feat(sdk): register Pi as a built-in ACP provider and pre-install pi-acp in agent-server Docker image - #4419

Open
Deep070203 wants to merge 2 commits into
OpenHands:mainfrom
Deep070203:feat/pi-acp-provider
Open

feat(sdk): register Pi as a built-in ACP provider and pre-install pi-acp in agent-server Docker image#4419
Deep070203 wants to merge 2 commits into
OpenHands:mainfrom
Deep070203:feat/pi-acp-provider

Conversation

@Deep070203

Copy link
Copy Markdown

HUMAN:

Resolves OpenHands/OpenHands#16204 by adding first-class upstream support for the Pi ACP coding agent in the SDK provider registry (ACP_PROVIDERS) and pre-installing pi-acp in the openhands-agent-server base Docker image.
This allows Pi to be selected as a native ACP server discriminator (acp_server: "pi"), matching the behavior of claude-code, codex, and gemini-cli.


AGENT:

Why

Per review on OpenHands PR #16229 and issue OpenHands/OpenHands#16204, pi should not rely on frontend-only custom command spoofing or docker-mode hacks in agent-canvas. Instead, pi needs first-class upstream support in software-agent-sdk (alongside claude-code, codex, and gemini-cli) so that downstream clients and agent-server Docker containers get native Pi ACP support automatically.

Summary

  • Registered "pi" in ACPServerKind discriminator union and ACP_PROVIDERS registry (display_name="Pi", default_command=("npx", "-y", "pi-acp@0.0.33"), binary_name="pi-acp", data_dir_env_var="PI_CODING_AGENT_DIR").
  • Pre-installed pi-acp@0.0.33 and created PATH wrappers under /usr/local/bin/ in openhands-agent-server Dockerfile.
  • Added comprehensive unit test coverage for registry metadata, command resolution, and per-conversation data directory isolation.

Issue Number

OpenHands/OpenHands (#16204)

How to Test

  1. Run the SDK unit test-suite
uv run pytest tests/sdk/settings/test_acp_providers.py tests/sdk/test_settings.py tests/sdk/agent/test_acp_agent.py
  1. Build and verify the local Docker image:
docker build -f openhands-agent-server/openhands/agent_server/docker/Dockerfile -t openhands-agent-server:pi-test .
docker run --rm --entrypoint /bin/sh openhands-agent-server:pi-test -c "which pi-acp"

Video/Screenshots

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Requires a bump in @openhands/typescript-client once released to expose "pi" to agent-canvas.

Co-authored-by: openhands <openhands@all-hands.dev>
@Deep070203

Copy link
Copy Markdown
Author

@VascoSch92 can you take a look and test and let me know if everything is working correctly.

)

_PI_MODELS: tuple[ACPModelOption, ...] = (
ACPModelOption(id="default", label="Default"),

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.

why default here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Unlike Claude Code, Codex, or Gemini CLI, pi-acp manages model resolution internally or via environment configuration.
Setting id="default" with default_model="default" allows the SDK to pass a clean, non-null model option while letting pi-acp use its native default engine setup

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

left some comments. Perhaps look on what other ACP are doing.

Thanks :-)

Comment thread openhands-sdk/openhands/sdk/settings/acp_providers.py Outdated
Comment thread openhands-sdk/openhands/sdk/settings/acp_providers.py Outdated
Comment thread openhands-agent-server/openhands/agent_server/docker/Dockerfile Outdated
Comment thread openhands-sdk/openhands/sdk/settings/acp_providers.py Outdated
@Deep070203

Copy link
Copy Markdown
Author

@VascoSch92 resolved the comments. Check and let me know!

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.

[Feature] Support Pi as ACP Agent

2 participants