Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/build-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -195,6 +197,7 @@ jobs:
- { suffix: "-hermes" }
- { suffix: "-grok" }
- { suffix: "-antigravity" }
- { suffix: "-pi" }
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.

Expand Down
38 changes: 38 additions & 0 deletions Dockerfile.pi
Original file line number Diff line number Diff line change
@@ -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 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.
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"]
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)** 🎉

Expand All @@ -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 │ └──────────────────┘
Expand All @@ -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))
Expand Down Expand Up @@ -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)

Expand Down
4 changes: 4 additions & 0 deletions charts/openab/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ 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
(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
Expand Down
22 changes: 22 additions & 0 deletions charts/openab/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 6 additions & 1 deletion docs/config-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}" }`). |
Expand Down Expand Up @@ -146,6 +146,11 @@ command = "opencode"
args = ["acp"]
working_dir = "/home/node"

# Pi Agent
[agent]
command = "pi-acp"
working_dir = "/home/node"

# Cursor Agent
[agent]
command = "cursor-agent"
Expand Down
109 changes: 109 additions & 0 deletions docs/pi.md
Original file line number Diff line number Diff line change
@@ -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.
5 changes: 3 additions & 2 deletions docs/steering-design-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

---

Expand Down Expand Up @@ -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 |

---

Expand Down
Loading