Add dedicated ACP server runtime with model selection support#545
Merged
GCWing merged 3 commits intoGCWing:mainfrom Apr 26, 2026
Merged
Add dedicated ACP server runtime with model selection support#545GCWing merged 3 commits intoGCWing:mainfrom
GCWing merged 3 commits intoGCWing:mainfrom
Conversation
Use the official agent-client-protocol crate from a new bitfun-acp crate and keep bitfun-cli as the startup host only. Also move shared AgenticSystem assembly into core and fix UTF-8 cursor handling in the CLI startup workspace input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR moves BitFun's ACP server integration out of the CLI-specific module into a dedicated
bitfun-acpcrate and expands the ACP server surface so editor clients can use BitFun more like a first-class ACP agent.Key changes:
src/crates/acpcrate backed by the officialagent-client-protocolcrate.bitfun-cli acpas the startup host while moving ACP protocol/runtime logic behind a reusable crate boundary.session/set_modelandsession/set_config_option.<think>...</think>text chunks into ACP thought chunks so reasoning markup does not leak into normal assistant messages.Motivation
BitFun is evolving from only exposing local product flows to also acting as an ACP-compatible agent server. The previous ACP implementation lived under the CLI app and mixed protocol handling with CLI runtime concerns. That made it harder to reuse, harder to compare against other ACP servers, and incomplete for clients such as Zed that expect session model/config options.
This PR follows the repository boundary rule: product/session behavior stays in
bitfun-core, while ACP protocol adaptation lives in a dedicated adapter crate.Implementation Notes
bitfun-acpdepends onbitfun-core; no core crate depends on ACP.EventQueue::subscribe()lets ACP listen to core events without consuming the global event stream.ConversationCoordinator::update_session_agent_typeandupdate_session_modelare used as the core-facing mutation points for ACP mode/model changes.mcpServersare converted into ephemeral MCP server configs so they are available for the session runtime without changing saved user configuration.autooption to preserve BitFun's existing mode/agent default-model behavior, plus all enabled configured models.<think>markup, preserving literal tags in normal message text.Validation
cargo check -p bitfun-acpcargo test -p bitfun-acpcargo build -p bitfun-cli --release