From 5786cfca43745d757ca261ad6d365899877b545d Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Mon, 25 May 2026 19:13:22 +0000 Subject: [PATCH 1/8] feat(pi): support Pi coding agent via Dockerfile.pi --- AGENTS.md | 2 +- Dockerfile.pi | 38 ++++++++++++++++++++ charts/openab/templates/NOTES.txt | 3 ++ charts/openab/values.yaml | 22 ++++++++++++ docs/config-reference.md | 8 ++++- docs/pi.md | 58 +++++++++++++++++++++++++++++++ docs/steering-design-guide.md | 5 +-- 7 files changed, 132 insertions(+), 4 deletions(-) create mode 100644 Dockerfile.pi create mode 100644 docs/pi.md diff --git a/AGENTS.md b/AGENTS.md index 666c44162..b1b774bab 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,7 +75,7 @@ Never leak `DISCORD_BOT_TOKEN` or other OAB credentials to the agent. ### 4. Dockerfile Discipline -There are 7 Dockerfiles: `Dockerfile`, `Dockerfile.claude`, `Dockerfile.codex`, `Dockerfile.copilot`, `Dockerfile.cursor`, `Dockerfile.gemini`, `Dockerfile.opencode`. +There are 8 Dockerfiles: `Dockerfile`, `Dockerfile.claude`, `Dockerfile.codex`, `Dockerfile.copilot`, `Dockerfile.cursor`, `Dockerfile.gemini`, `Dockerfile.opencode`, `Dockerfile.pi`. A change to one MUST be evaluated against ALL. Common layers (base image, openab binary, tini) are shared — update all or explain why not. diff --git a/Dockerfile.pi b/Dockerfile.pi new file mode 100644 index 000000000..c706ec5b9 --- /dev/null +++ b/Dockerfile.pi @@ -0,0 +1,38 @@ +# --- Build stage --- +FROM rust:1-bookworm AS builder +WORKDIR /build +COPY Cargo.toml Cargo.lock ./ +RUN mkdir src && echo 'fn main() {}' > src/main.rs && cargo build --release && rm -rf src +COPY src/ src/ +RUN touch src/main.rs && cargo build --release + +# --- Runtime stage --- +FROM node:22-bookworm-slim +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps ripgrep tini bubblewrap socat && rm -rf /var/lib/apt/lists/* + +# Install pi-acp adapter and Pi coding agent CLI. +# The Pi coding agent npm package was renamed from @mariozechner/pi-coding-agent to @earendil-works/pi-coding-agent. +ARG PI_ACP_VERSION=0.0.27 +ARG PI_CODING_AGENT_VERSION=0.75.4 +RUN npm install -g pi-acp@${PI_ACP_VERSION} @earendil-works/pi-coding-agent@${PI_CODING_AGENT_VERSION} --retry 3 + +# Install gh CLI (matches other Dockerfiles) +RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + -o /usr/share/keyrings/githubcli-archive-keyring.gpg && \ + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" \ + > /etc/apt/sources.list.d/github-cli.list && \ + apt-get update && apt-get install -y --no-install-recommends gh && \ + rm -rf /var/lib/apt/lists/* + +ENV HOME=/home/node +WORKDIR /home/node + +COPY --from=builder --chown=node:node /build/target/release/openab /usr/local/bin/openab + +RUN mkdir -p /home/node/.pi && chown -R node:node /home/node/.pi + +USER node +HEALTHCHECK --interval=30s --timeout=5s --retries=3 \ + CMD pgrep -x openab || exit 1 +ENTRYPOINT ["tini", "--"] +CMD ["openab", "run", "-c", "/etc/openab/config.toml"] diff --git a/charts/openab/templates/NOTES.txt b/charts/openab/templates/NOTES.txt index 89b01ef65..69322118d 100644 --- a/charts/openab/templates/NOTES.txt +++ b/charts/openab/templates/NOTES.txt @@ -39,6 +39,9 @@ Agents deployed: {{- else if eq (toString $cfg.command) "opencode" }} Authenticate: kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- opencode auth login +{{- else if eq (toString $cfg.command) "pi-acp" }} + Authenticate: + kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- pi /login {{- else if eq (toString $cfg.command) "cursor-agent" }} Authenticate: kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- cursor-agent login diff --git a/charts/openab/values.yaml b/charts/openab/values.yaml index 8db333258..049e7df35 100644 --- a/charts/openab/values.yaml +++ b/charts/openab/values.yaml @@ -126,6 +126,28 @@ agents: # agentsMd: "" # resources: {} # image: "ghcr.io/openabdev/openab-opencode:latest" + # pi: + # command: pi-acp + # discord: + # enabled: true + # allowedChannels: + # - "YOUR_CHANNEL_ID" + # allowedUsers: [] + # workingDir: /home/node + # env: {} + # envFrom: [] + # secretEnv: [] + # pool: + # maxSessions: 10 + # sessionTtlHours: 24 + # reactions: + # enabled: true + # removeAfterReply: false + # persistence: + # enabled: true + # storageClass: "" + # size: 1Gi + # image: "ghcr.io/openabdev/openab-pi:latest" # cursor: # command: cursor-agent # args: diff --git a/docs/config-reference.md b/docs/config-reference.md index 520d69987..3cab55368 100644 --- a/docs/config-reference.md +++ b/docs/config-reference.md @@ -95,7 +95,7 @@ The AI agent subprocess that OpenAB spawns to handle messages via ACP. | Key | Type | Default | Description | |-----|------|---------|-------------| -| `command` | string | *required* | Agent binary (e.g. `kiro-cli`, `claude-agent-acp`, `codex`, `gemini`, `copilot`, `opencode`, `cursor-agent`). | +| `command` | string | *required* | Agent binary (e.g. `kiro-cli`, `claude-agent-acp`, `codex`, `gemini`, `copilot`, `opencode`, `pi-acp`, `cursor-agent`). | | `args` | string[] | `[]` | CLI arguments passed to the agent. | | `working_dir` | string | `"/tmp"` | Working directory for the agent process. | | `env` | map | `{}` | Extra environment variables (e.g. `{ OPENAI_API_KEY = "${OPENAI_API_KEY}" }`). | @@ -146,6 +146,12 @@ command = "opencode" args = ["acp"] working_dir = "/home/node" +# Pi Agent +[agent] +command = "pi-acp" +working_dir = "/home/node" +env = { ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" } + # Cursor Agent [agent] command = "cursor-agent" diff --git a/docs/pi.md b/docs/pi.md new file mode 100644 index 000000000..a8b679f01 --- /dev/null +++ b/docs/pi.md @@ -0,0 +1,58 @@ +# Pi Coding Agent + +Pi is a minimalist, terminal-based AI coding agent designed for extensibility and developer control. It supports various modes and interfaces, including running inside the Zed editor or other Agent Client Protocol (ACP) clients. + +In OpenAB, Pi runs via the `pi-acp` adapter, which translates ACP stdio JSON-RPC messages into Pi RPC commands. + +## Use Cases + +1. **High Context Utilization Tasks**: Because Pi's system prompt is extremely small and it only exposes 4 core tools (`read`, `write`, `edit`, `bash`), it leaves maximum context window space for code and project files. It is perfect for large context tasks where other bloated agents run out of token space or become slow. +2. **Flexible Multi-Model Switching**: Pi supports switching between 15+ LLM providers mid-session. It is ideal for workflows where you want to use different models for different steps (e.g., Claude 3.5 Sonnet for logic reasoning, DeepSeek-Coder for quick edits, and Gemini for massive context ingestion). +3. **Exploratory / Branching Workflows**: Pi saves sessions as tree structures. If you want the agent to explore different implementation paths without losing previous state, Pi allows you to easily branch sessions. +4. **Secure Team Environments**: Combined with `openab-auth-proxy`, you can configure OpenAB to run Pi with centralized OAuth tokens (like xAI OAuth) rather than storing developer API keys in plain text on local machines. + +## Advantages + +- **Minimalism & Speed**: Very low system prompt overhead, saving up to 80% of standard system prompt tokens compared to other feature-rich agents. +- **Client-Side & Open-Source**: Pi runs completely locally/locally-hosted. It is MIT-licensed, giving you total data sovereignty. +- **Extensible via skills**: Developers can write skills in TypeScript and ask Pi to install or even generate them dynamically. + +## Docker Image + +```bash +docker build -f Dockerfile.pi -t openab-pi:latest . +``` + +The image installs `pi-acp` and `@earendil-works/pi-coding-agent` globally via npm. + +## Helm Install + +```bash +helm install openab openab/openab \ + --set agents.kiro.enabled=false \ + --set agents.pi.discord.enabled=true \ + --set agents.pi.discord.botToken="$DISCORD_BOT_TOKEN" \ + --set-string 'agents.pi.discord.allowedChannels[0]=YOUR_CHANNEL_ID' \ + --set agents.pi.image=ghcr.io/openabdev/openab-pi:latest \ + --set agents.pi.command=pi-acp \ + --set agents.pi.workingDir=/home/node +``` + +## Manual config.toml + +```toml +[agent] +command = "pi-acp" +working_dir = "/home/node" +env = { ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" } +``` + +## Authentication + +To authenticate with providers: + +- **Environment variables**: Pass `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc., via the agent's `env` configuration or `secretEnv`. +- **Interactive login**: Run `/login` inside the Pi agent: + ```bash + kubectl exec -it deployment/openab-pi -- pi /login + ``` diff --git a/docs/steering-design-guide.md b/docs/steering-design-guide.md index 2b63fdb35..aed5b13ed 100644 --- a/docs/steering-design-guide.md +++ b/docs/steering-design-guide.md @@ -10,13 +10,13 @@ AI coding agents load persistent instructions every session, but without deliber This guide establishes a universal framework for organizing agent memory into layers, so rules are reliably followed, context budgets are respected, and teams can onboard new agents without starting from scratch. -OpenAB is designed to be agent-agnostic — it supports Kiro, Claude Code, Codex, Gemini, Copilot, and OpenCode running side by side. This guide provides a shared memory architecture standard that allows all supported coding agents to maintain consistent behavior, collaborate effectively, and operate from a single source of truth regardless of their underlying platform differences. +OpenAB is designed to be agent-agnostic — it supports Kiro, Claude Code, Codex, Gemini, Copilot, OpenCode, and Pi running side by side. This guide provides a shared memory architecture standard that allows all supported coding agents to maintain consistent behavior, collaborate effectively, and operate from a single source of truth regardless of their underlying platform differences. --- How to organize AI agent memory across three tiers: hot (always loaded), warm (triggered on demand), and cold (searched when needed). -Applies to: Kiro, Claude Code, Codex, Gemini, Copilot, OpenCode — any agent that supports persistent instruction files. +Applies to: Kiro, Claude Code, Codex, Gemini, Copilot, OpenCode, Pi — any agent that supports persistent instruction files. --- @@ -165,6 +165,7 @@ Applies to: Kiro, Claude Code, Codex, Gemini, Copilot, OpenCode — any agent th | Gemini | `GEMINI.md` hierarchical (`~/.gemini/GEMINI.md` global → `./GEMINI.md` project → subdir) + `MEMORY.md` index | Same hierarchical pattern as CC/Codex. Private project memory index is hot; individual memory files are cold | | Copilot | `.github/copilot-instructions.md` (repo-wide) + `.github/instructions/**/*.instructions.md` (path-specific) + `AGENTS.md` (nearest-in-tree, where supported: cloud agent / CLI) | Layered: Personal > Path-specific > Repo-wide > Agent > Organization. No documented hard size cap for Chat/Agent (code review reads first 4K chars only). Keep short (~2 pages recommended) | | OpenCode | `AGENTS.md` or equivalent | Follows repo convention | +| Pi | `AGENTS.md` hierarchical (project root → global) + `SYSTEM.md` or `APPEND_SYSTEM.md` in `.pi/` | Project or global `SYSTEM.md` replaces the default system prompt, while `APPEND_SYSTEM.md` appends to it. `AGENTS.md` is loaded hierarchically for context injection | --- From 20c0e86d8e459a898bffa92146fcc96be83fccb7 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Mon, 25 May 2026 19:18:27 +0000 Subject: [PATCH 2/8] fix(pi): install git in Dockerfile.pi --- Dockerfile.pi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.pi b/Dockerfile.pi index c706ec5b9..71268ffe8 100644 --- a/Dockerfile.pi +++ b/Dockerfile.pi @@ -8,7 +8,7 @@ RUN touch src/main.rs && cargo build --release # --- Runtime stage --- FROM node:22-bookworm-slim -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl procps ripgrep tini bubblewrap socat && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git procps ripgrep tini bubblewrap socat && rm -rf /var/lib/apt/lists/* # Install pi-acp adapter and Pi coding agent CLI. # The Pi coding agent npm package was renamed from @mariozechner/pi-coding-agent to @earendil-works/pi-coding-agent. From 14dcd9c323e4221d60b162c58a4f5071fa2fabdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=96=AC?= Date: Mon, 25 May 2026 19:24:06 +0000 Subject: [PATCH 3/8] chore: fix CI matrices and Dockerfile count --- .github/workflows/build-operator.yml | 3 +++ .github/workflows/docker-smoke-test.yml | 1 + AGENTS.md | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-operator.yml b/.github/workflows/build-operator.yml index 165cc58d3..1339ea824 100644 --- a/.github/workflows/build-operator.yml +++ b/.github/workflows/build-operator.yml @@ -75,6 +75,7 @@ jobs: - { suffix: "-hermes", dockerfile: "Dockerfile.hermes", artifact: "hermes" } - { suffix: "-grok", dockerfile: "Dockerfile.grok", artifact: "grok" } - { suffix: "-antigravity", dockerfile: "Dockerfile.antigravity", artifact: "antigravity" } + - { suffix: "-pi", dockerfile: "Dockerfile.pi", artifact: "pi" } platform: - { os: linux/amd64, runner: ubuntu-latest } - { os: linux/arm64, runner: ubuntu-24.04-arm } @@ -141,6 +142,7 @@ jobs: - { suffix: "-hermes", artifact: "hermes" } - { suffix: "-grok", artifact: "grok" } - { suffix: "-antigravity", artifact: "antigravity" } + - { suffix: "-pi", artifact: "pi" } runs-on: ubuntu-latest permissions: contents: read @@ -195,6 +197,7 @@ jobs: - { suffix: "-hermes" } - { suffix: "-grok" } - { suffix: "-antigravity" } + - { suffix: "-pi" } runs-on: ubuntu-latest permissions: contents: read diff --git a/.github/workflows/docker-smoke-test.yml b/.github/workflows/docker-smoke-test.yml index 62cc58c7e..da5cc2980 100644 --- a/.github/workflows/docker-smoke-test.yml +++ b/.github/workflows/docker-smoke-test.yml @@ -23,6 +23,7 @@ jobs: - { dockerfile: Dockerfile.hermes, suffix: "-hermes", agent: "hermes-acp", agent_args: "" } - { dockerfile: Dockerfile.grok, suffix: "-grok", agent: "grok", agent_args: "agent stdio" } - { dockerfile: Dockerfile.antigravity, suffix: "-antigravity", agent: "agy-acp", agent_args: "" } + - { dockerfile: Dockerfile.pi, suffix: "-pi", agent: "pi-acp", agent_args: "" } runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 diff --git a/AGENTS.md b/AGENTS.md index b1b774bab..b61901c68 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -75,7 +75,7 @@ Never leak `DISCORD_BOT_TOKEN` or other OAB credentials to the agent. ### 4. Dockerfile Discipline -There are 8 Dockerfiles: `Dockerfile`, `Dockerfile.claude`, `Dockerfile.codex`, `Dockerfile.copilot`, `Dockerfile.cursor`, `Dockerfile.gemini`, `Dockerfile.opencode`, `Dockerfile.pi`. +There are 11 Dockerfiles: `Dockerfile`, `Dockerfile.antigravity`, `Dockerfile.claude`, `Dockerfile.codex`, `Dockerfile.copilot`, `Dockerfile.cursor`, `Dockerfile.gemini`, `Dockerfile.grok`, `Dockerfile.hermes`, `Dockerfile.opencode`, `Dockerfile.pi`. A change to one MUST be evaluated against ALL. Common layers (base image, openab binary, tini) are shared — update all or explain why not. From a8e49d23bd44a21e80e7d77235339f5da9eeaf43 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Mon, 25 May 2026 19:56:25 +0000 Subject: [PATCH 4/8] docs(pi): remove standalone Pi guide --- docs/pi.md | 58 ------------------------------------------------------ 1 file changed, 58 deletions(-) delete mode 100644 docs/pi.md diff --git a/docs/pi.md b/docs/pi.md deleted file mode 100644 index a8b679f01..000000000 --- a/docs/pi.md +++ /dev/null @@ -1,58 +0,0 @@ -# Pi Coding Agent - -Pi is a minimalist, terminal-based AI coding agent designed for extensibility and developer control. It supports various modes and interfaces, including running inside the Zed editor or other Agent Client Protocol (ACP) clients. - -In OpenAB, Pi runs via the `pi-acp` adapter, which translates ACP stdio JSON-RPC messages into Pi RPC commands. - -## Use Cases - -1. **High Context Utilization Tasks**: Because Pi's system prompt is extremely small and it only exposes 4 core tools (`read`, `write`, `edit`, `bash`), it leaves maximum context window space for code and project files. It is perfect for large context tasks where other bloated agents run out of token space or become slow. -2. **Flexible Multi-Model Switching**: Pi supports switching between 15+ LLM providers mid-session. It is ideal for workflows where you want to use different models for different steps (e.g., Claude 3.5 Sonnet for logic reasoning, DeepSeek-Coder for quick edits, and Gemini for massive context ingestion). -3. **Exploratory / Branching Workflows**: Pi saves sessions as tree structures. If you want the agent to explore different implementation paths without losing previous state, Pi allows you to easily branch sessions. -4. **Secure Team Environments**: Combined with `openab-auth-proxy`, you can configure OpenAB to run Pi with centralized OAuth tokens (like xAI OAuth) rather than storing developer API keys in plain text on local machines. - -## Advantages - -- **Minimalism & Speed**: Very low system prompt overhead, saving up to 80% of standard system prompt tokens compared to other feature-rich agents. -- **Client-Side & Open-Source**: Pi runs completely locally/locally-hosted. It is MIT-licensed, giving you total data sovereignty. -- **Extensible via skills**: Developers can write skills in TypeScript and ask Pi to install or even generate them dynamically. - -## Docker Image - -```bash -docker build -f Dockerfile.pi -t openab-pi:latest . -``` - -The image installs `pi-acp` and `@earendil-works/pi-coding-agent` globally via npm. - -## Helm Install - -```bash -helm install openab openab/openab \ - --set agents.kiro.enabled=false \ - --set agents.pi.discord.enabled=true \ - --set agents.pi.discord.botToken="$DISCORD_BOT_TOKEN" \ - --set-string 'agents.pi.discord.allowedChannels[0]=YOUR_CHANNEL_ID' \ - --set agents.pi.image=ghcr.io/openabdev/openab-pi:latest \ - --set agents.pi.command=pi-acp \ - --set agents.pi.workingDir=/home/node -``` - -## Manual config.toml - -```toml -[agent] -command = "pi-acp" -working_dir = "/home/node" -env = { ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" } -``` - -## Authentication - -To authenticate with providers: - -- **Environment variables**: Pass `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, etc., via the agent's `env` configuration or `secretEnv`. -- **Interactive login**: Run `/login` inside the Pi agent: - ```bash - kubectl exec -it deployment/openab-pi -- pi /login - ``` From 50fcceaaa119767b813f9107ff7d1a776a1468be Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Mon, 25 May 2026 19:58:58 +0000 Subject: [PATCH 5/8] chore: remove redundant Anthropic API key env from config-reference.md --- docs/config-reference.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/config-reference.md b/docs/config-reference.md index 3cab55368..e93e48314 100644 --- a/docs/config-reference.md +++ b/docs/config-reference.md @@ -150,7 +150,6 @@ working_dir = "/home/node" [agent] command = "pi-acp" working_dir = "/home/node" -env = { ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" } # Cursor Agent [agent] From 83f2934e109f1494a911421d9c921ba2f1f8f5b5 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Mon, 25 May 2026 19:59:34 +0000 Subject: [PATCH 6/8] chore: correct Helm NOTES.txt instructions for Pi agent authentication --- charts/openab/templates/NOTES.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/openab/templates/NOTES.txt b/charts/openab/templates/NOTES.txt index 69322118d..c18989a07 100644 --- a/charts/openab/templates/NOTES.txt +++ b/charts/openab/templates/NOTES.txt @@ -41,7 +41,8 @@ Agents deployed: kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- opencode auth login {{- else if eq (toString $cfg.command) "pi-acp" }} Authenticate: - kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- pi /login + kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- pi + (Once inside the interactive interface, type `/login` to authenticate) {{- else if eq (toString $cfg.command) "cursor-agent" }} Authenticate: kubectl exec -it deployment/{{ include "openab.agentFullname" (dict "ctx" $ "agent" $name) }} -- cursor-agent login From e103520956a05cffe6e302cdd1117b73ab350a91 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Tue, 26 May 2026 01:00:01 +0000 Subject: [PATCH 7/8] docs(pi): add docs/pi.md with advantages over other native coding agents - No auth proxy required (native subscription support like Codex/Copilot) - Minimal tool surface (4 tools) maximizes context window - Multi-model support (15+ providers, switchable mid-session) - Branching session trees for code exploration --- docs/pi.md | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 docs/pi.md diff --git a/docs/pi.md b/docs/pi.md new file mode 100644 index 000000000..3ff4a19c8 --- /dev/null +++ b/docs/pi.md @@ -0,0 +1,109 @@ +# Pi Coding Agent + +OpenAB supports the [Pi coding agent](https://github.com/earendil-works/pi-coding-agent) via the `pi-acp` adapter — a Node.js bridge that translates ACP JSON-RPC into Pi CLI invocations. + +## Advantages Over Other Native Coding Agents + +Pi is a native coding agent that supports subscription-based authentication (like Codex, Cloud Code, and GitHub Copilot). Key advantages: + +### No Auth Proxy Required + +Pi natively supports Anthropic (Claude Pro/Max) and ChatGPT Plus/Pro subscriptions via OAuth. Unlike agents that require an `openab-auth-proxy` sidecar for subscription forwarding, Pi handles subscription auth directly — reducing deployment complexity and eliminating a moving part. + +| Agent | Subscription Auth | Auth Proxy Needed? | +|-------|------------------|--------------------| +| Pi | Native OAuth (`pi /login`) | ❌ No | +| Codex | Native device flow | ❌ No | +| GitHub Copilot | Native device flow | ❌ No | +| Claude Code | Native OAuth | ❌ No | +| Kiro | Native OAuth | ❌ No | + +### Minimal Tool Surface (Maximum Context Window) + +Pi exposes only 4 core tools: `read`, `write`, `edit`, `bash`. Combined with a tiny system prompt, this drastically reduces prompt overhead and maximizes the available context window for actual project source files. + +| Agent | Tool Count | System Prompt Size | +|-------|-----------|-------------------| +| Pi | 4 | Minimal | +| Claude Code | 10+ | Large | +| Codex | 8+ | Medium | +| Copilot | 10+ | Large | + +### Multi-Model Support + +Pi is model-agnostic and supports 15+ LLM providers. Developers can switch models mid-session without restarting the agent or changing configuration. + +Supported providers include: +- Anthropic (Claude) — via subscription or API key +- OpenAI (GPT/Codex) — via subscription or API key +- Google (Gemini) — via API key +- Any OpenAI-compatible endpoint + +### Branching Session Trees + +Pi saves session history as trees, enabling clean branching of code exploration. This allows developers to explore multiple approaches from a single decision point without losing context. + +## Configuration + +```toml +[agent] +command = "pi-acp" +working_dir = "/home/node" +``` + +## Docker + +```bash +docker build -f Dockerfile.pi -t openab-pi:latest . +``` + +## Helm + +```yaml +agents: + pi: + discord: + enabled: true + allowedChannels: + - "YOUR_CHANNEL_ID" + command: pi-acp + workingDir: /home/node + image: "ghcr.io/openabdev/openab-pi:latest" +``` + +## Authentication + +```bash +kubectl exec -it deployment/openab-pi -- pi +# Once inside the interactive interface, type /login to authenticate +``` + +Supported authentication methods: + +| Provider | Auth Method | Subscription | +|----------|-------------|-------------| +| Anthropic (Claude Pro/Max) | OAuth via `pi /login` | Claude subscription | +| ChatGPT Plus/Pro | OAuth via `pi /login` | ChatGPT subscription | +| Any API key provider | `env = { OPENAI_API_KEY = "..." }` | Pay-per-token | + +## Steering Files + +Pi reads steering files in this order: + +1. `.pi/SYSTEM.md` — replaces the default system prompt entirely +2. `.pi/APPEND_SYSTEM.md` — appends to the default system prompt +3. `AGENTS.md` — loaded hierarchically (project root → global) for context injection + +Place your steering instructions in `/home/node/AGENTS.md` or `/home/node/.pi/APPEND_SYSTEM.md`. + +## Persisted Paths (PVC) + +| Path | Contents | +|------|----------| +| `/home/node/.pi/` | Pi configuration and auth tokens | +| `/home/node/.pi/sessions/` | Session history trees | + +## Limitations + +- **No streaming**: `pi-acp` returns the full response at once; streamed output is sent as a single `agent_message_chunk` notification. +- **Cancel is best-effort**: Pi CLI runs to completion; `session/cancel` may not interrupt mid-generation. From e6fa164d104a98aaadd2460d26f420476bb42960 Mon Sep 17 00:00:00 2001 From: chaodu-agent Date: Tue, 26 May 2026 01:00:52 +0000 Subject: [PATCH 8/8] docs(pi): add Pi agent to README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 73da28f2f..a8afbf515 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ![OpenAB banner](images/banner.jpg) -A lightweight, secure, cloud-native ACP harness that bridges **Discord, Slack**, and any [Agent Client Protocol](https://github.com/anthropics/agent-protocol)-compatible coding CLI (Kiro CLI, Claude Code, Codex, Gemini, OpenCode, Copilot CLI, Hermes, Grok Build, Antigravity, etc.) over stdio JSON-RPC — delivering the next-generation development experience. **Telegram, LINE, Feishu/Lark, Google Chat**, and other webhook-based platforms are supported via the standalone [Custom Gateway](gateway/). +A lightweight, secure, cloud-native ACP harness that bridges **Discord, Slack**, and any [Agent Client Protocol](https://github.com/anthropics/agent-protocol)-compatible coding CLI (Kiro CLI, Claude Code, Codex, Gemini, OpenCode, Copilot CLI, Hermes, Grok Build, Antigravity, Pi, etc.) over stdio JSON-RPC — delivering the next-generation development experience. **Telegram, LINE, Feishu/Lark, Google Chat**, and other webhook-based platforms are supported via the standalone [Custom Gateway](gateway/). 🪼 **Join our community!** Come say hi on Discord — we'd love to have you: **[🪼 OpenAB — Official](https://discord.gg/DmbhfDZjQS)** 🎉 @@ -22,8 +22,8 @@ A lightweight, secure, cloud-native ACP harness that bridges **Discord, Slack**, │ LINE │◄──webhook──┌──────────────────┐ │ opencode acp │ │ User │ │ Custom Gateway │ │ grok agent stdio │ ├──────────────┤ │ (standalone) │ │ agy-acp │ -│ Feishu/Lark │◄───WS──────│ │ └──────────────────┘ -│ User │ │ │ +│ Feishu/Lark │◄───WS──────│ │ │ pi-acp │ +│ User │ │ │ └──────────────────┘ ├──────────────┤ │ │ │ Google Chat │◄──webhook──│ │ │ User │ └──────────────────┘ @@ -38,7 +38,7 @@ A lightweight, secure, cloud-native ACP harness that bridges **Discord, Slack**, - **Multi-platform** — supports Discord and Slack, run one or both simultaneously - **Custom Gateway** — extend to Telegram, LINE, Feishu/Lark, Google Chat, MS Teams via standalone [gateway](gateway/) -- **Pluggable agent backend** — swap between Kiro CLI, Claude Code, Codex, Gemini, OpenCode, Copilot CLI, Hermes, Grok Build, Antigravity via config +- **Pluggable agent backend** — swap between Kiro CLI, Claude Code, Codex, Gemini, OpenCode, Copilot CLI, Hermes, Grok Build, Antigravity, Pi via config - **@mention trigger** — mention the bot in an allowed channel to start a conversation - **Thread-based multi-turn** — auto-creates threads; no @mention needed for follow-ups - **Multi-agent collaboration** — bot-to-bot messaging for coordinated workflows ([docs/multi-agent.md](docs/multi-agent.md)) @@ -171,6 +171,7 @@ The bot creates a thread. After that, just type in the thread — no @mention ne | Hermes Agent | `hermes-acp` | Native | [docs/hermes.md](docs/hermes.md) | | Grok Build | `grok agent stdio` | Native | [docs/grok.md](docs/grok.md) | | Antigravity | `agy-acp` | [agy-acp](agy-acp/) | [docs/antigravity.md](docs/antigravity.md) | +| Pi | `pi-acp` | [pi-acp](https://www.npmjs.com/package/pi-acp) | [docs/pi.md](docs/pi.md) | > 🔧 Running multiple agents? See [docs/multi-agent.md](docs/multi-agent.md)