Skip to content

feat(acp): support built-in slash commands in ACP runtime - #2060

Open
xielixing wants to merge 1 commit into
GCWing:mainfrom
xielixing:fix/issue-1118-acp-builtin-commands
Open

feat(acp): support built-in slash commands in ACP runtime#2060
xielixing wants to merge 1 commit into
GCWing:mainfrom
xielixing:fix/issue-1118-acp-builtin-commands

Conversation

@xielixing

Copy link
Copy Markdown

Summary

Adds built-in slash command support to the BitFun ACP (Agent Client Protocol) server runtime.

Changes

  • New module runtime/commands.rs: Defines four built-in commands (/help, /clear, /compact, /status) and provides:

    • builtin_commands() — returns the command list for client advertisement
    • advertise_builtin_commands() — sends AvailableCommandsUpdate to the client after session creation (errors are logged, never block session setup)
    • try_handle_builtin_command() — intercepts slash commands server-side before forwarding to the LLM, returning a response directly for known commands
  • runtime/session.rs: Calls advertise_builtin_commands after publish_active_session succeeds in both create_session and restore_session

  • runtime/prompt.rs: Intercepts built-in slash commands in run_prompt before the normal agent dialog submission

  • runtime.rs: Registers the new commands module

Test plan

  • cargo check -p bitfun-acp passes
  • cargo test -p bitfun-acp — all 115 tests pass (including 3 new unit tests for command uniqueness, help text completeness, and status text fields)
  • cargo clippy -p bitfun-acp — no new warnings

Closes #1118

Add /help, /clear, /compact, /status built-in commands to the ACP
server runtime. Commands are advertised to clients via
AvailableCommandsUpdate after session creation, and intercepted
server-side before forwarding to the LLM.

Closes GCWing#1118
@xielixing
xielixing force-pushed the fix/issue-1118-acp-builtin-commands branch from 3623d50 to ef78de5 Compare August 5, 2026 06:24
xielixing pushed a commit to xielixing/BitFun that referenced this pull request Aug 5, 2026
Three afternoon PRs ballooned to ~8.8k added lines because the agent
branched its fix worktrees from the host checkout's HEAD, which sat on
the in-flight feature branch; the whole feature diff rode along into
each PR. The preamble now requires basing every fix branch on
origin/<default> after a fetch, never on the host checkout's current
branch. The three contaminated branches were rebased onto origin/main
and force-pushed (PRs GCWing#2058/GCWing#2059/GCWing#2060 now carry only their own fix).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

【feature】 希望对 acp agent 内置命令做一下支持

1 participant