mirror of
https://github.com/agentclientprotocol/claude-agent-acp.git
synced 2026-11-07 18:01:07 +00:00
dd67450fd9bddc82db3e71273b535e07b2672804
## Summary - emit ACP `usage_update` notifications from top-level Claude `stream_event` message usage - keep tracking a usage snapshot across `message_start` and `message_delta` so partial deltas still produce a complete total - preserve the existing `result`-path update as the final exact/cost-bearing usage event ## Why Claude SDK stream events already carry incremental usage on `message_delta`, but `claude-agent-acp` currently ignores that path and only emits `usage_update` from the final `result`. This makes usage appear stale until the turn ends in ACP clients that expect live context usage updates. ## Verification - built the repo with `npm run build` - ran a direct ACP stdio client against the patched local build - observed `usage_update` notifications emitted before the final result-path usage update Patched local smoke-test output included this sequence: - `usage_update used=20973 size=200000` - `agent_message_chunk text=TEST_OK` - `usage_update used=20989 size=200000` - `usage_update used=20989 size=1000000 cost=0.1314875` --------- Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
ACP adapter for the Claude Agent SDK
Use Claude Agent SDK from ACP-compatible clients!
This tool implements an ACP agent by using the official Claude Agent SDK, supporting:
- Context @-mentions
- Images
- Tool calls (with permission requests)
- Following
- Edit review
- TODO lists
- Interactive (and background) terminals
- Custom Slash commands
- Client MCP servers
Learn more about the Agent Client Protocol.
Contribution Policy
This project does not require a Contributor License Agreement (CLA). Instead, contributions are accepted under the following terms:
By contributing to this project, you agree that your contributions will be licensed under the Apache License, Version 2.0. You affirm that you have the legal right to submit your work, that you are not including code you do not have rights to, and that you understand contributions are made without requiring a Contributor License Agreement (CLA).
Description
Pull mirror of agentclientprotocol/claude-agent-acp (Apache-2.0): the ACP bridge that lets Buzz drive Claude Code
Languages
TypeScript
98.8%
JavaScript
1.1%
Shell
0.1%