Skip to content

fix(acp): restore v2 usage updates - #29

Merged
danielkov merged 1 commit into
mainfrom
fix/acp-v2-usage-reporting
Aug 26, 2026
Merged

fix(acp): restore v2 usage updates#29
danielkov merged 1 commit into
mainfrom
fix/acp-v2-usage-reporting

Conversation

@danielkov

Copy link
Copy Markdown
Contributor

Summary

Restore ACP v2 context usage notifications so clients receive provider-reported context occupancy and window size. This makes the TUI context gauge visible again while continuing to suppress updates when the provider does not report a meaningful window.

Motivation

The ACP v2 migration left AgentEvent::UsageUpdated unhandled in the server adapter. Provider usage remained present in the canonical transcript, but ACP clients never received it.

Technical details

Usage translation

The Kit observer translates token totals and the provider's context-window metadata into an ACP v2 UsageUpdate before delegating other events to AgentKit. It intentionally omits the optional ACP cost because AgentKit reports per-turn cost while ACP defines this field as cumulative session cost.

Coverage

The regression test verifies that usage without a known context window is suppressed and that known usage is emitted with the expected numerator and denominator.

@danielkov
danielkov merged commit e060cad into main Aug 26, 2026
2 checks passed
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