Skip to content

fix: pair ACP permissions, hide self-reporting tools, cap oversized event content#439

Open
AlexanderZ-Band wants to merge 3 commits into
devfrom
feat/acp-permission-pairing-and-event-cap-INT-1005-INT-1014
Open

fix: pair ACP permissions, hide self-reporting tools, cap oversized event content#439
AlexanderZ-Band wants to merge 3 commits into
devfrom
feat/acp-permission-pairing-and-event-cap-INT-1005-INT-1014

Conversation

@AlexanderZ-Band

Copy link
Copy Markdown
Collaborator

Summary

  • Permission requests now emit matched tool_call/tool_result events with a shared call ID and explicit outcome; ACP narration for self-reporting Band tools (band_send_message, band_send_event, create_agent_chat_message) is suppressed so visible room output isn't duplicated or ordered after its own reply.
  • AgentTools.send_event now truncates oversized event content at the shared chokepoint (16384 char cap enforced by the Agent Events API) instead of failing the send with a 422, keeping both head and tail of the string.

Combines #423 and #437 into a single branch/PR against dev. Both source PRs will be closed as superseded.

Test plan

  • uv run ruff check .
  • uv run pytest tests/runtime/test_tools.py tests/integrations/acp/ -q --no-cov (352 passed, 8 skipped)

🤖 Generated with Claude Code

AlexanderZ-Band and others added 2 commits July 14, 2026 18:59
Permission requests now emit matched tool_call and tool_result events
with a shared call ID and explicit outcome. ACP narration for
self-reporting Band tools (band_send_message, band_send_event, and
standalone MCP message names) is suppressed so visible room output is
not duplicated or ordered after its own reply.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-1014]

The Agent Events API rejects content over 16384 chars with a 422, which the
ACP/GitHub Copilot backend hit when mirroring large tool_call/tool_result
payloads (e.g. get_file_contents on a big file). AgentTools.send_event now
truncates oversized content at the shared chokepoint, keeping both the head
and tail of the string so the tail (often the informative part of a raw
error dump) isn't silently dropped.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 14, 2026

Copy link
Copy Markdown

INT-1005

INT-1014

…ent content

ACPCollectingClient._tool_result_chunk only read update.raw_output; agents
that report output via the content block list instead (e.g. Copilot's ACP
agent on a plain `env` run) fell through to an empty string, which the
Agent Events API rejects with a 422 ("content can't be blank") and tears
down the whole ACP session via on_message's error handler. Recover real
text from content blocks (filtered by their explicit type tag, not by
diff/terminal entries happening to lack a .content attribute), and add a
send_event placeholder for the cases with no text at all.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@AlexanderZ-Band AlexanderZ-Band requested a review from a team July 14, 2026 19:09
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.

1 participant