Repository navigation
[v0.10.3] Full ACP compatibility for bb, Zed, JetBrains, and all ACP-compatible editors #4027
sks7777
started this conversation in
Feature requests
Replies: 1 comment
|
Hi maintainers 👋 I've updated my fork to v0.10.3 — sks7777/prime-agent@local/v0.10.3. All 9 blocks from the plan above are implemented and tested on this branch. I'm ready to split them into separate PRs against |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Context
I use bb as my primary IDE. The bb-plugin-prime-agent-acp bridge connects bb to Prime Agent through the Agent Client Protocol (ACP) — a JSON-RPC 2.0 over stdio protocol for editor/agent communication, maintained by Zed Industries.
Prime Agent already runs as an ACP server (
prime-agent --mode acp). The bb plugin implements a dialect layer that maps Prime Agent's namespaced_metafields onto bb deltas. But the Rust ACP server in upstreammaindoes not serve the full method surface the dialect expects.Problem
After the v0.10.2 release (2026-10-28), three maintainers landed 43 merged PRs and have 95 open PRs. The local fork (
local/v0.10.3) has ~4,500 lines of ACP additions that are not in upstream. Without these, bb users experience:session/load(theloadSessioncapability)usage_updateinsession/updateavailable_commands_updateinsession/updatesession/set_config_optionfor ask/plan/code/debugsession/newmirror-thread rebindsession/updatecoalescer mergesagent_thought_chunkdeltasThis also affects Zed, JetBrains Air, SuperQode, and Neovim (codecompanion.nvim) — every ACP-compatible client benefits from the full method surface.
Goal
Bring the ACP layer in upstream
mainto full compatibility with the ACP v1 spec, so thatprime-agent --mode acpworks as a first-class provider in bb — and in any other ACP-compatible editor — without local fork patches.High-level approach
The work decomposes into 9 logical blocks across 3 phases. Each block is a separate PR with a changelog fragment, regression tests, and parity-diff evidence.
Phase 1 (parallel, no inter-block dependencies)
Block 1 —
session/load+session/fork(critical):Cross-process session registry so bb can resume and fork sessions after IDE or daemon restart. Implements
session/load(optional,loadSessioncapability) andsession/fork(draft-only in v2,session.forkcapability). Newsession_registry.rs(~511 lines),ForkCapability,SessionLoadParams,SessionForkParams.session/newmints fresh UUIDs (noworking directoryreuse). Cwd validation withallowForeignCwdopt-out perworkspace-root-security.Block 2 —
session/steering(critical, PR #3684):Mid-turn message injection without cancelling in-flight tools. ACP v2 prompt-lifecycle describes steering as emergent Agent behavior; this PR makes it explicit via a
session/steeringextension method advertised in_metaatinitialize. Port of nano-rlm #205. Newsteer_runs.rs(~232 lines),DaemonCommand::Steervariant in pa-types,SteeringParams,_meta.steering.supportedininitialize. Full race-condition handling:session/cancelvs admission, prompt failure post-admission, steer vs armed cancel.Block 3 — Streaming fixes (high):
session/updatenotifications:agent_thought_chunkbypasses the coalescer to deliver per-token chunks (prevents cumulative duplication in bb's thinking-block renderer). Flush superseded delta on kind switch (thought → message) inpark_update. Matches the ACP v1 tool-calls streaming contract (one chunk per event, not merged).Block 4 —
usage_update+available_commands_update(high):Two missing
session/updatekinds:usage_update(carriesused= totalTokens +size= contextWindow for a completed assistant response) andavailable_commands_update(slash commands for bb autocomplete, usinginput.hintas a nested object per the session-updates shape).contextWindowadded to enginemodel_metadatasoget_connection_stateexposes it.Block 5 — Session modes: ask/plan/code/debug (PRIMER-4, high):
Implements session-modes via session-config-options. New
session_mode.rsin pa-core (~998 lines).session/newadvertisesmodeconfig option (select: ask/plan/code/debug).session/set_config_optionswitches mode. Plan mode blocks write tools (read-only enforcement per exiting-plan-modes,mode-blockedflag ontool_callcontent).AcpSessionUpdate::Planfromgoal_update(theplanupdate kind).Phase 2 (depends on Block 1)
Block 6 — bb-mirror threads (critical):
session/newmirror-thread rebind for RLM subagents inside bb. Newrlm_bb_mirror.rs(~766 lines).rlm.spawncreates a mirror bb thread: claim file (single-use + TTL) → spawn thread → rebind onto childsession. Model + reasoning-level forwarding. Stale claim → re-spawn. Waker bridge for parent notification. Uses_metasubagentsfield for visibility.Block 7 — Prompt recovery (critical):
ACP connection survives daemon restart using
session/loadto re-attach. Bounded wait (180s, poll 2s) re-attaches to the replacement daemon.closed_input_pausefor gracefulsession/closeshutdown handling. Without this,session/cancelduring a daemon restart orphans the session.Phase 3 (depends on Block 7)
Block 8 — Orphaned worker + bash fixes (high):
Edge cases at the cancellation / session-setup boundary. Passivation path does not skip workers with stale inflight permits (fixes session restore hanging after cancel-during-turn). ACP bridge identity backfill on pre-PRIMER-6 descriptors.
Block 9 —
_meta.autoRetry(medium):PrimeAgentAutoRetryMeta— phase (waiting/recovered/exhausted), attempt, maxAttempts, delayMs, reason, backupModel. Published insession_info_updatevia_metaunderai.primeintellect.prime-agent. Surfaces provider auto-retry state to ACP clients.I have a working implementation of all these blocks in the local fork and I'm ready to contribute them as separate PRs against
main.All reactions