Repository navigation
fix(a2a): show A2A task usage through the usage extension - #1529
Merged
Merged
Conversation
Go ADK agents put execution_stats but no usage in the task metadata, so every A2A row claimed 0 tokens in the subagent list, the task view and the stats line the parent agent reads. Zero tokens now means unreported, and all three drop the token figures instead. The missing usage itself is fixed upstream in the ADK and mock-agent. Refs #1526
9 of 10 tasks
ADK 0.33.0 moved task usage behind the A2A usage extension: namespaced metadata keys that an agent only returns to a request listing the extension in the A2A-Extensions header. Bump the ADK, send the header from the client factory so every request activates it, and read the new keys for the subagent stats and the task result lines. Refs #1526
edenreich
force-pushed
the
fix/a2a-unreported-usage
branch
from
October 4, 2026 17:56
70dc344 to
7b2a644
Compare
2 tasks done
Contributor
|
🎉 This PR is included in version 0.225.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A2A tasks always showed
0tokens. The ADK dropped the streamed usage, and the CLI rendered missing usage as zero. Both sides are fixed now: the ADK side shipped in ADK v0.33.0 (inference-gateway/adk#397) and this PR is the CLI side.Activate the usage extension and read its keys
ADK 0.33.0 moved task usage behind the A2A usage extension. Its metadata keys are namespaced by the URI, and an agent only returns them to a request that lists the extension in the
A2A-Extensionsheader.adkto v0.33.0.A2A-Extensions: adk.UsageExtensionURIin the single client factory (infrastructure/client.go), so every request activates the extension.adk.UsageMetadataKey/adk.ExecutionStatsMetadataKeyintaskRunStats(subagent stats) andappendTaskMetadataLines(task result lines).docs/a2a-connections.mdandexamples/a2a/README.md. The example README showed an old tree-style block, so it now shows the current child line.Hide token figures when an agent reports no usage
Zero tokens now means "not reported". The subagent list, the task view and the stats line the parent agent reads all drop the token figures instead of claiming
0.Breaking
Agents on ADK < 0.33.0 no longer show tool counts or tokens, since they only write the old bare keys. Older agents never returned streamed usage anyway.
Test plan
TestNewClient_ActivatesUsageExtensionchecks that a request from the client factory carriesA2A-Extensions: <URI>.job_test.go/submit_task_test.goread the namespaced keys.TestA2AJobStatsWithoutUsagechecks that execution stats without usage giveTools: 1 succeeded, 0 failed, with no token part. It fails without the fix.TestSubagentListStatsIconsDimAtZeroexpects no token segment for zero-token stats.go test ./internal/... ./config/... ./cmd/...andtask precommit:runare clean.Refs #1526