Repository navigation
Conversation
yuluo-yx
left a comment
There was a problem hiding this comment.
Two reproduced usage gaps:
- Repair timeout:
repairUsageis unknown, but totalusageremains (1,2,3). A missing response does not prove zero consumption; keep the delivery total unknown. - Repair responds with usage but invalid output:
finish()throws before emitting the mergedUsageUpdate. Both model modes leave event consumers at (1,2,3), while the exception result reports (11,22,33). Emit the merged usage before propagating validation failure.
|
Thanks @yuluo-yx — both reproduced gaps are fixed in 548a9e5 (TDD: failing assertions first, then the two production changes):
agent-core 250/250 and the graph callResult/streamResult suites stay green; the graph path needs no production change since its strict-delivery results come from the same finalizer. |
确认 (Acknowledged) contribution to ARGI: the structured-output repair re-ask now folds its reported token usage into the delivered AgentResult total via per-field null-propagating aggregation (Usage.plus, matching UsageAccumulator/NodeUsage semantics, so unknown fields stay unknown and are never summed as zero, including a null main usage), with a new repairUsage result segment distinguishing main-call from repair consumption (null = no repair issued, all-unknown = repair issued with unreported usage, the old 5-arg AgentResult constructor kept for source compatibility), counting every issued-and-answered call exactly once across successful repair, repaired-still-invalid and response-without-assistant-message paths while a client failure before any response counts nothing guessed, and the independent ReAct finish() backfills the merged total into the Finished outcome plus one cumulative UsageUpdate so event consumers and callResult/streamResult deliveries agree on the same invocation totals, for #207. Consumer impact: AgentResult (opt-in strict-delivery type) gains one record component and Usage gains one additive method, both unreleased post-2.1.0-RC1 surface; Finished/UsageUpdate now carry repair-inclusive totals on repaired runs, which is the intended fix; no estimation path is introduced — unreported consumption stays unknown.