Skip to content

feat(acp): tool call lifecycle — InProgress/Completed notifications and terminal timeout (#926)#950

Merged
bug-ops merged 5 commits intomainfrom
feat/acp-926-tool-lifecycle
Feb 26, 2026
Merged

feat(acp): tool call lifecycle — InProgress/Completed notifications and terminal timeout (#926)#950
bug-ops merged 5 commits intomainfrom
feat/acp-926-tool-lifecycle

Conversation

@bug-ops
Copy link
Owner

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

Summary

  • G5: ACP tool notifications now follow the protocol-specified two-step lifecycle. SessionUpdate::ToolCall(InProgress) is emitted before tool execution; SessionUpdate::ToolCallUpdate(Completed|Failed) with content is emitted after. Each tool call is identified by a UUID threaded through LoopbackEvent::ToolStart and LoopbackEvent::ToolOutput.
  • G6: AcpShellExecutor enforces a configurable wall-clock timeout (default 120 s) on IDE-proxied shell commands. On expiry: kill_terminal_command is called, partial output is returned, and AcpError::TerminalTimeout is propagated to the agent loop.

Changes

Crate File Change
zeph-core channel.rs Add LoopbackEvent::ToolStart; extend LoopbackEvent::ToolOutput with tool_call_id and is_error; add Channel::send_tool_start
zeph-core agent/tool_execution.rs Generate UUIDs before parallel execution; emit send_tool_start per tool; thread tool_call_id / is_error into send_tool_output
zeph-acp agent.rs loopback_event_to_update returns Vec<SessionUpdate>; maps ToolStartToolCall(InProgress), ToolOutput → `ToolCallUpdate(Completed
zeph-acp terminal.rs Add timeout_secs field; wrap wait_for_terminal_exit in tokio::time::timeout; call kill_terminal_command on expiry
zeph-acp error.rs Add TerminalTimeout { output } variant
zeph-channels any.rs Update send_tool_output signature
zeph-tui channel.rs Update send_tool_output signature

Test plan

  • All 2856 existing unit tests pass (cargo nextest run --workspace --lib --bins)
  • cargo clippy --workspace -- -D warnings — zero warnings
  • cargo +nightly fmt --check — clean

Add LoopbackEvent::ToolStart emitted before tool execution and extend
LoopbackEvent::ToolOutput with tool_call_id and is_error fields. UUIDs
are generated per tool invocation and threaded through the pipeline.

ACP agent now emits SessionUpdate::ToolCall(InProgress) before execution
and SessionUpdate::ToolCallUpdate(Completed|Failed) with content after,
correcting the previous behavior of emitting a single Completed event.

Add configurable terminal command timeout (default 120s) to
AcpShellExecutor. On timeout: kill_terminal_command is called, partial
output is collected, and AcpError::TerminalTimeout is returned.

Closes #926 (G5, G6)
Document G5 two-step tool call lifecycle (InProgress/Completed) and
G6 terminal command timeout in advanced/acp.md, advanced/tools.md,
and the zeph-acp/zeph-core crate READMEs.

Add terminal_timeout_secs to configuration table and add ACP Tool
Notifications section to tools.md explaining UUID correlation and
tool kind mapping.
@github-actions github-actions bot added documentation Improvements or additions to documentation channels User interface channels rust core enhancement New feature or request size/L labels Feb 26, 2026
…riant

Add tool_call_id and is_error params to AppChannel::send_tool_output,
add ToolStart arm to daemon.rs match to fix non-exhaustive pattern error.
Resolve merge conflicts in zeph-acp README and docs/advanced/acp.md,
preserving both G5/G6 changes and upstream protocol docs additions.
@bug-ops bug-ops enabled auto-merge (squash) February 26, 2026 02:56
@bug-ops bug-ops merged commit 8e7ae33 into main Feb 26, 2026
28 checks passed
@bug-ops bug-ops deleted the feat/acp-926-tool-lifecycle branch February 26, 2026 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channels User interface channels core documentation Improvements or additions to documentation enhancement New feature or request rust size/L

Projects

None yet

1 participant