Skip to content

feat(acp): implement protocol completeness (#922)#952

Merged
bug-ops merged 1 commit intomainfrom
feat/acp-922-protocol-completeness
Feb 26, 2026
Merged

feat(acp): implement protocol completeness (#922)#952
bug-ops merged 1 commit intomainfrom
feat/acp-922-protocol-completeness

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 26, 2026

Summary

Implements all P0/P1 ACP protocol gaps identified in the gap analysis for issue #922.

  • G2/G11: set_session_mode with ask/code/architect modes; current_mode_update notification on change
  • G3: AgentCapabilities advertises session capabilities (list/fork/resume)
  • G4: ext_notification handler (fire-and-forget)
  • G5: Tool call lifecycle — InProgress then Completed per output
  • G6: Terminal command timeout with kill_terminal_command; terminal_timeout_secs config (default 120s)
  • G7: ToolCallContent::Terminal for bash tool calls; terminal_id propagated through ToolOutput/LoopbackEvent
  • G8: MCP HTTP transport in mcp_bridge
  • G9: Structured tracing::warn for unsupported Audio/ResourceLink blocks
  • G10: UserMessageChunk echo after user prompt
  • G12–G14: list_sessions, fork_session, resume_session behind unstable_session_* feature flags (default-on); LRU eviction guard on fork/resume

Security

  • fork_session and resume_session check max_sessions and apply LRU eviction before insert
  • ext_method_mcp internal errors logged via tracing::error!, generic "internal error" returned to client
  • MCP stdio command injection not exploitable (Command::new, no shell)

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace -- -D warnings passes (0 warnings)
  • cargo nextest run --workspace --lib --bins — 2859 passed, 11 skipped
  • 4 new unit tests: initialize_advertises_session_capabilities, set_session_mode_valid_updates_current_mode, set_session_mode_unknown_mode_errors, ext_notification_always_ok

Implements gaps G1-G14 identified in the ACP gap analysis.

Protocol compliance (P0):
- set_session_mode with ask/code/architect modes and current_mode_update
  notifications on change (G2, G11)
- AgentCapabilities now advertises session_capabilities: list/fork/resume (G3)
- ext_notification handler: accepts fire-and-forget notifications (G4)

Behavioral improvements (P1):
- Tool call lifecycle: emit InProgress then Completed per tool output (G5)
- Terminal command timeout via kill_terminal_command; configurable via
  terminal_timeout_secs (default 120s) (G6)
- ToolCallContent::Terminal emitted for bash tool calls with terminal_id (G7)
- MCP HTTP server transport support in mcp_bridge (G8)
- UserMessageChunk echo notification after user prompt is sent (G10)
- Structured tracing::warn for unsupported Audio/ResourceLink blocks (G9)

Unstable session management (behind feature flags, default-on):
- list_sessions (unstable_session_list) (G12)
- fork_session with LRU eviction guard (unstable_session_fork) (G13)
- resume_session with LRU eviction guard (unstable_session_resume) (G14)

Security: ext_method_mcp internal errors logged via tracing::error,
generic "internal error" returned to client.

ToolOutput and LoopbackEvent::ToolOutput gain terminal_id: Option<String>;
all call sites updated.

4 new unit tests added for G2/G3/G4/G11. 2859 tests pass.
@bug-ops bug-ops force-pushed the feat/acp-922-protocol-completeness branch from fe45515 to 8e38a51 Compare February 26, 2026 04:02
@bug-ops bug-ops merged commit 0cd8f69 into main Feb 26, 2026
28 checks passed
@bug-ops bug-ops deleted the feat/acp-922-protocol-completeness branch February 26, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dependencies documentation Improvements or additions to documentation enhancement New feature or request rust size/XL tests

Projects

None yet

1 participant