ACP reports failed tool calls with status completed
Description
The ACP stream router sends every Bub tool result as tool_call_update(status='completed'), including results that Bub itself recorded as failures (BubError 'command exited with code N'); the client never receives status 'failed'.
Observed behavior: Failed bash calls (exit 1/127) are reported as status 'completed' with rawOutput {'kind':'tool','message':"Tool 'bash' execution failed.",...}; ABB's terminal_exited shows the non-zero exit code. Across all bub runs: 425 completed, 0 failed tool_call_update statuses; 85 completed updates carry 'command exited with'.
Steps to reproduce
- Use the tested revision and reproduction environment below.
- Prepare the fixture described here:
Use bub with bubbuild/bub-contrib's bub-acp-server plugin at revision 8727b088aea69615d44d3b58ab0b9be6d16a884e. The ACP client advertises terminal and fs read/write capabilities. Prepare tests/check_totals.py to fail an assertion and exit 1. Model: deepseek-chat.
- Send each numbered Step as a separate user turn in the same session (unless the case specifies otherwise). Preserve the supplied text:
Step 1: Please run the project's self-check script with `python3 tests/check_totals.py` and tell me whether all checks pass. If something fails, quote the error message. Don't modify any files.
- Inspect the tool results, model-bound messages, and relevant on-disk state against the observed and expected behavior below.
Expected behavior
Per the ACP ToolCallStatus contract and the plugin's promise to forward Bub tool events as session/update, a tool call that failed (non-zero exit, Bub tool error) should be reported with status 'failed'.
Actual behavior
Failed bash calls (exit 1/127) are reported as status 'completed' with rawOutput {'kind':'tool','message':"Tool 'bash' execution failed.",...}; ABB's terminal_exited shows the non-zero exit code. Across all bub runs: 425 completed, 0 failed tool_call_update statuses; 85 completed updates carry 'command exited with'.
Environment
Tested source revision: a93f5b80cf4b1bb35a248f4108b463f7af44f08d (ACP plugin: bubbuild/bub-contrib 8727b088aea69615d44d3b58ab0b9be6d16a884e packages/bub-acp-server).
Use bub with bubbuild/bub-contrib's bub-acp-server plugin at revision 8727b088aea69615d44d3b58ab0b9be6d16a884e. The ACP client advertises terminal and fs read/write capabilities. Prepare tests/check_totals.py to fail an assertion and exit 1. Model: deepseek-chat.
Model/provider: deepseek-chat via the recorded test harness.
Additional context
The defect is in the ACP plugin adapter. The main bub repository is the repository listed in the source table; the relevant implementation is in bubbuild/bub-contrib, packages/bub-acp-server.
Source review pointers at the tested revision:
bub-contrib packages/bub-acp-server/src/bub_acp_server/agent.py ACPStreamRouter._send_tool_results (~l.428-457, status='completed' hard-coded); client_tools.py _raise_for_failed_terminal; bub src/bub/core/tools.py ToolExecutor.execute_many (~l.339-346).
This report is prepared from recorded reproduction evidence. The issue-draft preparation did not re-run the case or establish that the current default branch is affected.