Skip to main content

bub-acp-server

Expose Bub as an Agent Client Protocol agent.

What It Provides

  • Bub plugin entry point: acp-server
  • CLI command registered on Bub: bub acp
  • Standalone console script: bub-acp-server
  • ACP agent methods for initialize, session/new, session/load, session/resume, session/list, session/close, and session/prompt
  • Streaming ACP session/update events from Bub stream events
  • ACP client-backed replacements for Bub's bash, fs.read, fs.write, and fs.edit tools while the ACP server is running
  • An ACP-aware update_plan tool that updates the client plan UI and records each complete plan as a plan event in the session tape
  • Automatic recovery of the latest persisted plan into the next ACP turn's model context
  • Session-scoped model and reasoning-effort selection through ACP config options
  • ACP context-compaction notifications when tape.handoff runs
  • Mid-turn steering through the _lody/session/steer ACP extension

Installation

uv pip install "git+https://github.com/bubbuild/bub-contrib.git#subdirectory=packages/bub-acp-server"

Or from a Bub project:

bub install bub-acp-server@main

Usage

Configure an ACP-compatible client to launch one of:

bub acp

The previous bub acp serve form remains accepted temporarily and prints a deprecation warning. Other positional arguments are rejected.

or:

bub-acp-server

The process speaks ACP over stdio. Prompts are sent through Bub's hook pipeline with stream output enabled, so model chunks and tool events can be displayed by the ACP client as they arrive.

The agent sends an ACP usage_update whenever the streamed usage snapshot changes, with a final end-of-stream check as a fallback. Missing token usage is reported as 0. If the model provider does not report its context-window size, set BUB_ACP_SERVER_CONTEXT_WINDOW_SIZE; the default is 128000 tokens.

ACP clients can select both the model and reasoning effort for each session. Reasoning effort defaults to auto; the selected value is persisted with the ACP session and passed into Bub's turn state for subsequent model calls.

While the ACP server is running, it replaces Bub's tape.handoff tool with an equivalent implementation and reports the operation as a context-compaction tool call. Compatible clients receive Context compacting and Context compacted updates marked with _meta.contextCompaction.

Bub keeps using its own configuration, tools, skills, and tapes. The ACP client starts the process and displays the session; it does not replace Bub's model setup.

ACP session IDs remain the protocol-facing chat_id. Bub namespaces its internal session ID with the ACP channel before selecting a tape, so an equal session ID from another channel cannot reuse the ACP tape.

ACP session metadata is stored under Bub home as acp-sessions.json so compatible clients can list sessions again after restarting. Keep BUB_HOME stable if you want the same ACP thread list across editor launches.

bub-acp-server supports both ACP session load and resume. session/load restores the matching Bub history through the same ACP streaming path used by live turns. session/resume attaches the editor back to the Bub session without replaying history, so later turns keep streaming through Bub's normal hook pipeline.

Steering

Clients can detect steering support in the initialize response:

{
  "_meta": {
    "steering": {
      "supported": true
    }
  }
}

Clients that require acknowledged steering can also negotiate the Lody extension under agentCapabilities._meta:

{
  "agentCapabilities": {
    "_meta": {
      "lody": {
        "steering": {
          "version": 1,
          "transport": "request",
          "upstreamTurn": "same",
          "configPolicy": "active"
        }
      }
    }
  }
}

Send a private ACP extension request while a turn is running or after it has become idle:

{
  "method": "_lody/session/steer",
  "params": {
    "sessionId": "session-id",
    "prompt": [
      {
        "type": "text",
        "text": "Stop the current approach and inspect the failing test first."
      }
    ],
    "steerId": "client-generated-steer-id"
  }
}

The response outcome is injected when Bub consumes the message at the next model-step boundary, startedNewTurn when the previous turn has already passed its final boundary, or failed for an unexpected internal failure. Steering requests are serialized per session and preserve arrival order. The extension is private rather than part of the standard ACP method set, so clients must opt into it explicitly.

When the message is applied, Bub sends _lody/session/steer_applied with the same sessionId and steerId, and returns injected. This lets the client distinguish submission from application.

For compatibility with clients using the original Codex steering extension, Bub also accepts _session/steering. Its optional steerId uses the matching _session/steering_applied notification.

Use In Zed

Zed supports external terminal agents through ACP. Custom agents are configured in Zed's settings.json under agent_servers.

Prerequisites:

  • bub is installed and available to Zed.
  • bub-acp-server is installed in the Bub environment:
bub install bub-acp-server@main

Open Zed's settings with the zed: open settings command and add a custom agent server:

{
  "agent_servers": {
    "Bub": {
      "type": "custom",
      "command": "bub",
      "args": ["acp"],
      "env": {}
    }
  }
}

If Zed cannot find bub, use the absolute path printed by command -v bub:

{
  "agent_servers": {
    "Bub": {
      "type": "custom",
      "command": "/absolute/path/to/bub",
      "args": ["acp"],
      "env": {}
    }
  }
}

After saving the settings, open Zed's agent panel with cmd-? on macOS or ctrl-? on Linux/Windows, then start a new thread and select Bub.

Useful Zed commands while testing:

  • dev: open acp logs shows the JSON-RPC traffic between Zed and Bub.
  • zed: open settings opens settings.json.

Notes:

  • Zed launches Bub as a separate ACP process. Bub reads its own local configuration and credentials directly.
  • Use env only for settings your Bub installation actually needs.
  • If your Bub configuration is loaded from a project .env, use a wrapper command that loads that file before running bub acp.

References:

Metadata

Release files for bub-acp-server 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bub-acp-server 0.0.3
File Size Uploaded
bub_acp_server-0.0.3.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bub-acp-server 0.0.3
File Interpreter ABI Platform
bub_acp_server-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 43.7 kB

Release files / bub_acp_server-0.0.3.tar.gz

Download URL bub_acp_server-0.0.3.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
24835a08e0411f9fddee5623365c953a235d14fe24cc64dd84e32e00fc96d3e9
BLAKE2b-256 checksum
How to use checksums
791ead73b1c5a86f8ee23c668e7255c12d523e5cc780c26d73a02dd6ad6c01d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bub_acp_server-0.0.3-py3-none-any.whl

Download URL bub_acp_server-0.0.3-py3-none-any.whl
Size 23.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0d81d187d3ffaee6a370ddd6302040a0d063a23af4c55c178a8d8493ecec6ba
BLAKE2b-256 checksum
How to use checksums
3d91de58e7e1e1f3920e166b191ede8bf3e6339b99ea4b8a71fb584fba11053c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

0.1.0

2 release files

0.0.4

2 release files

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page