* refactor(agy): isolate the stream-json transport in its own module
Move everything only the stream-json driver uses into
cli/src/agy/legacyStreamJson/: the driver and stream process, the NDJSON
parser, the conversation-DB model and title readers, the transcript entry
types, and the agy transcript producer that lived on ApiSessionClient as
sendAgySessionMessage. The driver now registers its own queued-message
cancel handler for batches held in its retry backoff instead of reaching
through AgySession.
The loop runs the remote session through agyRemoteLauncher, the one place
that picks a transport; it is the only importer of the new module. No
behavior change.
* feat(acp): report soft-steer usage and prompt timing to the caller
Antigravity ends a steered session/prompt request early and reports each
request's share of the turn in its own response. Let soft-steer callers
receive that usage so they can total it for the turn.
prompt() waits for earlier output before it sends and for late output
after the answer. Callers can now learn when the request was sent and
answered, and a soft steer exposes when it was answered, so they can time
the agent itself and run their own timers on its answers.
* fix(acp): keep the JSON-RPC error code on failed requests
A rejected request lost the agent's error code, and the soft-steer failure
log printed the Error as {}. The rejection now carries code and data, and
the log keeps the message and code.
* feat(agy): run Antigravity on agy acp when agy supports it
agy 1.5.0 added an ACP server. When `agy --version` reports 1.5.0 or
newer, agyRemoteLauncher runs the session on a new ACP launcher over the
shared AcpSdkBackend; older agy, or a version that cannot be read
(pre-release of 1.5.0, missing binary, no answer), keeps the stream-json
driver and says why in the session. The check and the stream-json
launcher live in legacyStreamJson/, behind one call.
On ACP, one agy acp process serves the session. The agy conversation id is
the ACP session id, so stored agySessionId values resume through
session/resume without replay, whichever transport started them. The
launcher marks the session with agyProtocol 'acp' in metadata; the
stream-json launcher removes a stale marker.
- Model and effort apply per turn through session/set_model with agy's
<model>-<effort> ids; clearing the model returns to agy's default. The
mode is sent every turn, since agy can change it on its own.
- A queued message counts as delivered once agy takes it (its echo,
output, or answer), or when it goes back to the composer.
- Permission modes map to ACP session modes. agy approval requests reach
HAPI through the shared ACP permission handler. agy titles a
run_command request with the command line, so the handler's name hints
for HAPI's own MCP tools (change_title, think, ...) are turned off for
agy; otherwise a command such as `grep think notes.md` would skip the
approval prompt. Automatic approvals pick a one-time option, because the
agy process outlives mode switches, and agy question requests always
wait for the user.
- Titles come from session_info_update, and each turn reports one usage
total built from the prompt responses.
- If the agy process dies, the next turn restarts it and resumes the
conversation (the transport now reports whether its process is alive).
A restart that fails part way leaves no half-started process in use;
the next turn tries again. A prompt agy never started is restored to
the composer.
* feat(agy): add accept-edits and plan permission modes
agy has default, accept-edits, and plan execution modes. Expose
accept-edits and plan as acceptEdits and plan next to request-review
(agy's default mode) and always-proceed. On agy acp they switch per turn
through session/set_mode without restarting agy; the stream-json driver
passes them as --mode, so a change restarts its process like other
launch settings. The iOS and Android catalogs mirror the new list.
* feat(agy): steer queued messages into the running turn
agy acp folds a second session/prompt into the running turn. Register the
SteerQueuedMessage handler in the agy ACP launcher and open the steering
gate for agy sessions whose metadata says agyProtocol 'acp'; stream-json
sessions stay queue-only. The launcher publishes the marker and registers
the handler before it starts agy, so the hub knows the protocol before any
turn can take a steer; until then the hub tells a steer on an agy session
that Steer is not available yet, rather than listing other flavors.
agy answers the request a steer interrupts at once (end_turn) while the
turn continues under the steer, and it lets a running tool call finish.
So the launcher keeps the turn, its steeringActive state, and thinking
until every open prompt request settles, and totals usage across them;
usage from a steer answered after its turn ended is not reported again.
agy echoes a steer as a user_message_chunk when it folds it in. The ACP
backend now reports those echoes after flushing the output before them,
and the launcher commits the steer when the echo text that follows the
prompt's own echo matches it (whitespace-insensitive; the longest steer
text wins when one contains another), so the message lands in the transcript where
it entered the turn rather than after the final answer. Each steer
resolves once (echoed or answered, held, or put back). agy rejects a
prompt while an approval is open, so a steer is refused then and the
message stays queued.
Stop applies to the whole turn lifetime. It withdraws Steer at once and
refuses steers that arrive after it. The turn is registered before agy
restarts or switches settings, so a Stop before the prompt is sent puts
it back in the composer, and a prompt still waiting to send is cancelled
as soon as it reaches agy. agy answers a cancelled prompt with a normal
`cancelled` result; when it produced no output, the prompt also goes back
to the composer. agy answers open requests with `cancelled` and
ends open tool calls; the turn's handler stays active so those final tool
updates still render. A steer cancelled before its echo is held for an
explicit Retry or Cancel, as for Cursor. A steer agy never answers is
dropped after a grace period: its row is held the same way and the agy
process is stopped (late permission requests are cancelled, not
approved), and the next turn restarts it. If agy ignores the cancel, its
process is stopped after a timeout in the same way.
* feat(agy): report and fall back when agy acp fails to start
An agy older than 1.5.0 never reaches this path: the version check in the
selection seam already runs it on stream-json. On 1.5.0 or newer, agy acp
can still fail to start or to open the conversation, for example when agy
is not signed in, the ACP install is broken, or the process exits during
start-up. The session used to end as crashed, without the reason.
The launcher now sends the reason to the chat, and the selection seam runs
the session on the stream-json driver instead, saying in the session that
Steer is not available. Only start failures fall back: errors after agy
acp is up end the session as before, and a kill during start-up is
neither reported as a failure nor falls back. The fallback stays in the
selection seam and legacyStreamJson/.
* feat(agy): show per-turn usage in the response footer
On agy acp each turn ends with a round summary: input, output, thinking,
cache-read and total tokens (summed across the requests of a steered
turn), the model, and agy's own time from sending the prompt to its last answer
(HAPI's waits before sending and for late output are left out), and
tok/s. agy reports no per-step timing, so generation time is that round
time minus the spans spent running tools or waiting for the user
(overlaps counted once), and generated tokens are output plus thinking,
as for OpenCode. The web footer renders it like the
other round summaries.
agy's usage adds up every model call of a request and agy sends no
usage_update, so it is not a context size. The turn's usage therefore no
longer goes out as a token_count for the context indicator, which stays
empty as it is for agy on stream-json.
* fix(agy): keep the session when Stop arrives while no turn is running
Stop aborts the queue wait and replaces the abort controller. The main
loop then checked the new controller's signal, found it not aborted, and
left the loop, so a late or repeated Stop after a turn had ended closed
the session and disconnected agy. The loop now checks the signal its
wait used and keeps waiting for the next message.
* fix(agy): confirm a steer only at its echo
A later steer makes agy answer an earlier steer's request at once
(end_turn) while the tool call and the turn go on, before agy has folded
the earlier steer in. Taking that answer as delivery marked the message
consumed, so a Stop before its echo left it without Retry or Cancel.
A steer is now confirmed when agy echoes it. An answer without an echo
counts only when the turn ends: confirmed if the turn ended without a
Stop, held for Retry or Cancel after one.
* fix(agy): hold unechoed steers when agy is lost mid-turn
An early-answered steer was confirmed when its turn ended without a Stop.
If agy exited before echoing it (for example when a later steer answered
its request and then the process died), the turn still ended without a
Stop, so the steer was marked consumed although agy may never have folded
it in, and Retry or Cancel was gone.
A steer request that fails with a lost transport now marks agy as lost
for the turn, and an early-answered steer without an echo is confirmed
only when the turn ends cleanly: no Stop and no lost agy process.
Otherwise it is held for Retry or Cancel.
* test(agy): pin how each steer outcome is decided
Cover the steer paths that had no test: a control command or a message
that left the queue is refused; a steer whose delivery state cannot be
recorded, or whose request agy loses while starting or writing it, is
held for Retry or Cancel; a steer sent while agy restarts stays queued
and runs next; an early-answered steer echoed before a Stop stays
confirmed; a steer agy rejects after a Stop goes back to the queue; the
main prompt stays delivered when Stop leaves a steer agy may have taken;
and an open steer is held when agy ignores the cancel or the session is
killed.
* fix(agy): confirm every steer that one echo chunk carries
When agy echoed two pending steers in one user_message_chunk, the first
match cleared every steer's echo text, so the other steer was not
confirmed at its echo. It was confirmed only when the turn ended, and a
Stop before then held it for Retry although agy had taken it. A match now
uses up only its own text, and the remaining steers keep matching.
* fix(agy): keep matching the prompt's echo after a stray echo
An echo chunk that did not continue the prompt (for example a late echo
from the previous turn) ended the wait for the prompt's own echo. The
prompt's echo that followed was then matched against the steers, so a
steer whose text the prompt contains could be confirmed before agy took
it. Such a chunk is now checked against the steers only, and the prompt's
echo is still recognized when it comes.
* fix(agy): settle the running turn before a kill returns
The runner ends the session and closes the client as soon as kill()
returns. kill() only cancelled the turn and disconnected agy, so a prompt
that was still waiting to send, or whose cancelled answer was still
draining, put itself back in the composer (or was confirmed) only after
that, and those events were lost; the session end could then record the
prompt as delivered without restoring it.
kill() now waits for the running turn to settle after disconnecting agy,
bounded to a few seconds so an agy that never settles cannot hold the
session end. Archive and runner stop both end the session through kill();
leaving remote mode does not apply to agy, and a normal exit waits for
the turn in the main loop.
* fix(web): choose the Antigravity permission mode when creating a session
The create form still showed Antigravity's old YOLO toggle, so a new
session could only start in request-review or always-proceed, although
the session mode picker offers request-review, acceptEdits, plan and
always-proceed. Antigravity now uses the same native permission select
as the other agents, filled from the shared mode catalog, and the chosen
mode is sent with the spawn.
The default stays as before: a stored YOLO toggle carries over
(on → always-proceed, off → request-review), otherwise the hub's default
applies, mapped onto agy's modes. Fallbacks that used the literal
'default' mode, which agy does not have, now ask the shared catalog for
the flavor's default instead.
22 KiB
Supported Agents
HAPI is a wrapper around AI coding agents. One CLI (hapi <agent>) starts any supported agent locally and exposes the same session for remote control from the web app, PWA, and Telegram — with permission prompts, message queueing, and seamless handoff between terminal and phone.
Run hapi without arguments to choose an agent interactively. The picker shows
all supported agents alphabetically by command name; missing or misconfigured
agents are disabled with a reason. Scripts must use hapi <agent> [options].
hapi --help shows HAPI's own help. Options after an agent name belong to that
agent's integration; their supported syntax varies by agent.
Support matrix
| Agent | Command | Integration | Local | Remote | Permission modes | Resume |
|---|---|---|---|---|---|---|
| Claude Code | hapi claude |
Terminal wrapper (local) + Claude Agent SDK (remote) | ✓ | ✓ | default acceptEdits auto bypassPermissions plan |
✓ |
| Codex | hapi codex |
Native terminal + codex app-server (Codex 0.154.0+) |
✓ | ✓ | default read-only autoReview yolo (+ plan collaboration mode) |
✓ |
| Cursor Agent | hapi cursor |
ACP (agent acp); legacy stream-json resume |
✓ | ✓ | default plan ask debug autoReview yolo |
✓ |
| Grok Build | hapi grok |
ACP (grok agent stdio) |
✓ | ✓ | default auto plan bypassPermissions |
✓ |
| GitHub Copilot | hapi copilot |
ACP (copilot --acp --stdio) |
✓ | ✓ | default read-only safe-yolo yolo |
✓ |
| Kimi | hapi kimi |
ACP (kimi acp) |
✓ | ✓ | default read-only safe-yolo yolo |
✓ |
| OpenCode | hapi opencode |
ACP (opencode acp) |
✓ | ✓ | default plan yolo |
✓ |
| DeepSeek Harness | hapi dsh |
ACP (dsh --profile acp or configured server) |
— | ✓ | Managed by DSH ACP composition | ✓* |
| Antigravity (agy) | hapi agy |
ACP (agy acp, agy 1.5.0+); persistent stream-json for older agy |
— | ✓ | request-review acceptEdits plan always-proceed |
✓ |
| Pi | hapi pi |
pi --mode rpc (JSON-line RPC over stdio) |
— | ✓ | none (always auto-approve) | ✓ |
| Gemini CLI | — | Removed — Google sunset the consumer Gemini CLI (2026-06-18) | — | — | — | — |
Gemini is no longer launchable: hapi gemini is kept as a tombstone command that prints a clear error, and existing Gemini sessions remain viewable in the web UI but cannot be resumed.
Common concepts
ACP
Most remote integrations speak the Agent Client Protocol (ACP) over stdio through a shared HAPI backend. ACP gives remote sessions bidirectional permission approval, plan/todo updates, question UI, model catalogs, and session resume via session/load. Cursor, Grok, Copilot, Kimi, OpenCode, Antigravity, and DeepSeek Harness remote sessions all run over ACP. DSH's official ACP server is automation-focused and currently supports committed assistant output, cancellation, one-shot permissions, native session resume via session/resume, and per-turn model switching through session/set_config_option; it does not provide MCP injection or live tool/reasoning telemetry. Legacy or incompatible DSH ACP servers fall back to a fresh session when native resume is unavailable.
Permission modes
Permission modes are per-agent — each flavor exposes its own set (see the matrix above). Set the mode at launch with --permission-mode <mode> or a shortcut flag (--yolo, --plan, --auto-review, depending on the agent), and switch it mid-session from the web UI. Semantics vary per agent; see the per-agent sections below.
Local and remote mode
Work locally in the terminal or remotely from web/phone, keeping the same conversation when you hand off. The support matrix shows which interfaces each agent offers; DSH, Pi, and Antigravity accept input only through HAPI's remote interface.
- Remote → local: continue in the terminal. If it shows the remote-control screen, press double-space to return to local input.
- Local → remote: send a message from the web UI or phone; HAPI handles the handoff.
See Seamless Handoff for details.
Resuming sessions
hapi resume # Interactive picker of resumable sessions on this machine
hapi resume <session-id> # Resume a specific HAPI session
hapi resume reopens the conversation on this machine, including active sessions you were using from your phone. Gemini cannot be resumed. DSH resume depends on the configured ACP server: current DSH ACP profiles restore the native session, while a fresh-session-only server starts a new session with a status message. Pi and Antigravity resume with input still controlled from HAPI rather than the terminal.
Mathematical formulas in HAPI Markdown
HAPI renders LaTeX-style mathematics through KaTeX. When generating or revising Markdown intended for display in HAPI, follow these rules exactly:
- Use
\( ... \)for inline mathematics. - Use
\[ ... \]for standalone display mathematics. - Do not use single-dollar delimiters such as
$x^2$. Single-dollar math is disabled to prevent currency values such as$200from being misinterpreted as formulas. $$ ... $$remains supported for compatibility, but\[ ... \]is preferred for display mathematics.- Do not put formulas inside inline code, fenced code blocks, or other code content.
- Use only LaTeX commands supported by KaTeX. TikZ is not supported.
- Do not use bare
[ ... ]as math delimiters.
Before sending a response, check every mathematical expression for the correct delimiters. Rewrite any mathematical $...$ expression as \(...\) or \[...\]; preserve ordinary currency text such as $200 as plain text.
Cursor Agent
HAPI supports Cursor Agent CLI for running Cursor's AI coding agent with remote control via web and phone.
When Cursor resumes mid-idle (for example after a Shell notify_on_output wake) and emits ACP activity, HAPI bumps session thinking over the normal session-alive keepalive so the list does not stay stuck idle. See FAQ.
Prerequisites
Install Cursor Agent CLI:
- macOS/Linux:
curl https://cursor.com/install -fsS | bash - Windows:
irm 'https://cursor.com/install?win32=true' | iex
Verify installation:
agent --version
Usage
hapi cursor # Start Cursor Agent session
hapi cursor resume <chatId> # Resume a specific chat
hapi cursor --continue # Resume the most recent chat
hapi cursor --plan # Start in Plan mode (shortcut)
hapi cursor --mode plan # Start in Plan mode
hapi cursor --mode ask # Start in Ask mode
hapi cursor --auto-review # Start with Auto (Smart Auto)
hapi cursor --yolo # Bypass approval prompts (--force)
hapi cursor --model <model> # Specify model
hapi cursor --cursor-worktree # Cursor-native worktree (auto-named)
hapi cursor --cursor-worktree feature-x # Cursor-native worktree (named)
hapi cursor --cursor-add-dir ../shared # Extra workspace root (repeatable)
Permission modes
| Mode | Description |
|---|---|
default |
Standard agent behavior |
plan |
Plan mode - design approach before coding |
ask |
Ask mode - explore code without edits |
debug |
Debug mode - hypotheses + instrumentation |
autoReview |
Auto (Smart Auto) - allowlist/sandbox/classifier instead of full YOLO |
yolo |
Bypass approval prompts |
Set mode via --plan / --mode / --permission-mode / --auto-review, or change from the web UI during a session.
Cursor-native worktree & multi-root
- New Session Worktree for Cursor uses Cursor's
--worktree(~/.cursor/worktrees/<repo>/<name>), not HAPI's sibling-directory worktree. - Exception: if the spawn
directoryis already a linked git worktree (HAPI feature worktree,driver/, etc.), the runner does not pass--cursor-worktree— nesting hangs ACP initialize (#1085). Use the directory as cwd instead. - Mid-session: send
/worktree,/apply-worktree,/delete-worktree, or/add-dir <path>(isolated pass-through). - CLI:
hapi cursor --cursor-worktree feature-x --cursor-add-dir ../shared - ACP ignores Cursor's plain-text
Using worktree: …stdout banner so remotesessionType: worktreecan initialize (fixed in #1085). Other non-JSON ACP stdout remains a fatal protocol error.
Slash pass-through (remote)
These commands are isolated in the queue and forwarded to the agent (ACP prompt or legacy -p):
/compress /summarize /compact /model /multitask /best-of-n /worktree /apply-worktree /delete-worktree /add-dir /context /fork /auto-review
Interactive TUI-only commands (/config, /mcp, /sandbox, /btw, /rewind, …) are not supported remotely.
Modes
- Local mode - Run
hapi cursorfrom terminal. Full interactive experience. - Remote mode - Spawn from web/phone when no terminal. New Cursor sessions use
agent acpwith HAPI permission approval, plan/question UI, and richer tool updates. Legacy sessions created before the ACP migration may still resume via the oldagent -pstream-json path temporarily.
Limitations
- Multitask UI -
/multitaskis slash-driven; HAPI does not yet provide an Agents Window-style fleet pane. Subagentcursor/tasknotifications show as CursorTask cards when the agent emits them. - Legacy sessions - Cursor sessions created before the ACP migration can still resume temporarily via stream-json. Start a new Cursor session to get ACP permissions, plans, todos, and question support.
- Session resume - ACP sessions resume through
session/load. Old stream-jsonsession_idvalues are not loadable via ACP; those sessions keep using the legacy path until you start fresh.
Legacy stream-json safety: AskQuestion behavior
New cursor remote sessions go through ACP, which handles AskQuestion via the bidirectional cursor/ask_question extension method and is immune to the issue below. The intercept described here exists only for legacy sessions that resume via the older agent -p stream-json launcher.
When running cursor-agent under --print --output-format stream-json, the cursor-agent CLI returns a synthetic Questions skipped by the user, continue with the information you already have response for the AskQuestion tool because there is no IDE surface to render the question. The agent's underlying model can interpret this as legitimate user consent and act on it.
HAPI's legacy event converter intercepts this synthetic response and rewrites it to an explicit no_input_surface error (status: failed), so downstream consumers (web UI, Telegram, log readers) surface the fabrication as an error instead of silently passing through fabricated consent. The intercept scans the raw tool_call payload for the literal marker text and is scoped to AskQuestion-shaped (and converter-fallback name=unknown) calls; legitimate read/write/function tools are not affected.
The intercept drains naturally with the legacy session population - resumed pre-ACP sessions are the only path that still hits this code.
Tracking issue: tiann/hapi#784.
Grok Build
HAPI can run the official Grok Build CLI locally and control the same coding session remotely from the Web/PWA.
Install
Install Grok Build using the official installer:
::: code-group
curl -fsSL https://x.ai/cli/install.sh | bash
irm https://x.ai/cli/install.ps1 | iex
:::
Verify the installation:
grok version
Authenticate
HAPI reuses the Grok CLI's local authentication. On a headless runner machine, authenticate once with device-code login:
grok login --device-auth
Alternatively, configure an xAI API key in the runner environment:
export XAI_API_KEY="xai-..."
Do not place API keys in HAPI configuration files, logs, or a repository.
Start a session
Start the native Grok Build TUI:
hapi grok
Start with explicit launch settings:
hapi grok --model grok-4.5 --effort low --permission-mode default
hapi grok --yolo # Shortcut for --permission-mode bypassPermissions
Sessions created from a HAPI runner start in remote mode automatically. Terminal-created sessions start in the native Grok TUI and can switch to remote control without parsing terminal output.
Permission modes
Grok exposes four permission modes:
default— tool requests are shown in HAPI for approval or denial.auto— Grok's own Auto mode: HAPI forwards Grok's/autocommand to the session. Auto depends on account and CLI-build availability — if Grok does not advertise the/autocommand, HAPI falls back todefaultand posts a notice in the session.plan— HAPI asks Grok to plan only and rejects tool execution requests.bypassPermissions— tool requests are automatically approved for the session (--yoloshortcut).
Use bypassPermissions only in a trusted workspace.
Resume and handoff
Remote mode uses Grok's ACP stdio agent (grok agent stdio). HAPI stores the native Grok session ID and uses it for:
- ACP
session/loadafter a restart. grok --resume <session-id>when switching back to the native TUI.hapi resume <hapi-session-id>from a terminal.
For a new local session, HAPI supplies a UUID with grok --session-id, so the session can be resumed without scraping the fullscreen TUI.
Fork and rewind
When the Grok CLI build advertises them, HAPI uses Grok's ACP extension methods to fork the conversation (current point or from an earlier message, via _x.ai/session/fork) and to rewind the conversation to an earlier prompt (via _x.ai/rewind/*). Capabilities are probed per session, so older builds simply hide these controls.
Model and effort controls
The Create page discovers Grok's ACP model catalog and the reasoning-effort choices advertised for each model. Remote sessions can switch both model and effort between turns; HAPI applies them through ACP session/set_model and session/set_mode. From the terminal, pick them at launch with --model <model> and --effort <level>.
HAPI also exposes Grok's common slash commands, discovers skills from .grok/skills, ~/.grok/skills, and shared .agents/skills, and asks Grok to set a concise HAPI session title after the first normal prompt.
Current limitations
- OAuth/device-code login must be completed outside the HAPI Web UI.
- Grok subscription, credit, and model availability are controlled by xAI.
If a remote session reports authentication failure, run grok login --device-auth on the runner machine and retry.
DeepSeek Harness
hapi dsh uses the shared ACP transport and keeps DSH's runtime outside HAPI. The
default entrypoint is the official dsh CLI with --profile acp (the ACP profile
ships with @deepseek-ai/dsh since 0.2.0). Configure a different ACP server or a
source checkout with HAPI_DSH_ACP_COMMAND, HAPI_DSH_ACP_CONFIG, or the JSON
argument array HAPI_DSH_ACP_ARGS_JSON. HAPI_DSH_ACP_CONFIG passes a --config
path to the server named by HAPI_DSH_ACP_COMMAND; on the default official CLI
(which has no --config flag) it is applied as a --patch overlay on top of
--profile acp.
npm install -g @deepseek-ai/dsh@0.2.0-rc.2
hapi dsh
The standalone legacy demo is still published as @deepseek-ai/dsh-acp-demo; use
it through an explicit override and an exact version such as 0.1.0-rc.7 rather
than npm's stale latest tag:
npm install -g @deepseek-ai/dsh-acp-demo@0.1.0-rc.7
A published package still needs a DSH Cordis composition/config. A source checkout can be launched directly:
export HAPI_DSH_ACP_COMMAND=pnpm
export HAPI_DSH_ACP_ARGS_JSON='["--dir", "/path/to/deepseek-harness", "run", "demo:acp"]'
hapi dsh
DSH sessions are remote-only. With a persistent DSH ACP profile, HAPI stores the
native DSH session id and restores model context with session/resume after a
restart or archive. The resume call does not replay the transcript; HAPI's Hub
message history remains the source for the chat UI. HAPI does not inject MCP
servers. Model selection is available: the DSH composition's model catalog is
exposed through the session RPC ListDshModels and applied per turn with ACP
session/set_config_option. Effort pickers are not exposed because the
official ACP contract leaves that surface to the DSH composition. Pending
one-shot permission requests remain answerable in the standard HAPI UI, but
the ACP composition owns the overall permission policy. A legacy or
fresh-session-only server falls back to a new session and surfaces that outcome
in the chat.
* Resume requires a DSH ACP server that implements session/resume.
HAPI's $ skill menu for DSH sessions reads the same skill roots DSH's own
skill filesystem uses: $DSH_HOME/skills (~/.dsh/skills by default), the
project's .dsh/skills, and the shared ~/.agents/skills / .agents/skills
directories. Since the ACP composition accepts no client-supplied MCP servers,
HAPI's skill_lookup bridge is not available to DSH sessions; a skill named in
the prompt is loaded by DSH through its own skill tool and catalog.
Other agents
-
Claude Code (
hapi claude) — local sessions wrap the native TUI, remote sessions drive the Claude Agent SDK. Claude Code docs -
Codex (
hapi codex) — OpenAI's Codex CLI, with terminal/Web control and a dedicatedplanmode. See Codex usage and limits for resume, terminal-exit behavior, and launch options. openai/codex -
GitHub Copilot (
hapi copilot) — Copilot CLI over ACP (copilot --acp --stdio). GitHub Copilot -
Kimi (
hapi kimi) — Moonshot AI's Kimi CLI over ACP (kimi acp). MoonshotAI/kimi-cli -
OpenCode (
hapi opencode) — the open-source OpenCode agent over ACP (opencode acp). opencode.ai -
Antigravity (
hapi agy) — Google's Antigravity CLI (agy) over ACP (agy acp, added in agy 1.5.0). HAPI checksagy --versionwhen the session starts; older agy releases, an agy whose version cannot be read, and anagy acpthat fails to start keep the previous persistent stream-json integration (no approval prompts in HAPI: tools without an allow-rule in agy'ssettings.jsonare auto-denied).On ACP, one
agy acpprocess serves the whole session. The agy conversation id is the ACP session id, so a session continues the same conversation throughsession/resumewithout replaying history, whichever integration started it. If the agy process dies, the next message restarts it and resumes the conversation; a prompt agy never started is restored to the composer. Stop sendssession/cancel, which also ends open tool calls; a prompt stopped before agy answered anything also goes back to the composer.On ACP, Steer a queued message to add it to the running turn instead of waiting for the turn to end. HAPI sends it as another
session/prompt; agy finishes any tool call already running, then continues the same turn with the new message. The turn's usage includes the steered part.Permission modes map to agy's session modes:
request-reviewis agy'sdefaultmode, which follows agy's own permission settings and, on ACP, shows its approval requests in HAPI;acceptEditsandplanare agy'saccept-editsandplanmodes;always-proceedapproves every request automatically. On ACP, mode changes apply to the next message without restarting agy. Conversation titles come from agy; on ACP each response's details show the turn's token usage.Remote-only — there is no local terminal input path or PTY/TUI wrapper. MCP servers are loaded natively from
~/.gemini/config/mcp_config.jsonor workspace.agents/mcp_config.json; HAPI does not inject its own MCP server. Google AntigravityIn the web model picker, models with multiple effort variants appear once, with a separate effort selector showing the levels in the machine's catalog. For example, choose Gemini 4 Argon and High, or launch with
hapi agy --model gemini-4-argon --effort high. Models with only one listed variant keep their original name and have no effort selector. Model and effort changes apply to subsequently sent messages; queued messages keep their settings. -
Pi (
hapi pi) — the Pi coding agent running aspi --mode rpc(JSON-line RPC over piped stdio); remote-control only, no local TUI input path. earendil-works/piHAPI translates a subset of Pi's TUI slash commands to native Pi RPC calls, so they work from the web chat as well:
/compact [instructions]— manually compact context with optional custom summary instructions (runs Pi'scompactRPC; the summary is rendered as a dedicated block in the chat with the token delta in its header)./session— show session stats (messages, tokens, cost, context usage)./model [modelId]— show the current model and available models, or switch with/model <modelId>./help— list the commands supported from HAPI.
Pi's extension commands and prompt templates (discovered via
get_commands) keep working from the/menu, and skills are available through$skill-namelike other ACP flavors. Other Pi TUI builtins (e.g./tree,/export,/reload) cannot run over RPC; typing them in web shows an explicit "terminal-only" notice instead of silently forwarding the text to the model.Pi sessions include a
hapi_display_imagetool for showing local PNG, JPEG, GIF, or WebP images up to 25 MiB in the chat. Images returned by Pi tools render inline even when the selected model has no vision support. The display tool also returns image bytes to Pi's model context.
Related
- How it Works - Architecture and data flow
- Quick Start - Install HAPI and start your first session