Repository navigation
fix(api): bill recorded model usage after agent errors - #2302
tomatomptt wants to merge 3 commits into
Conversation
Always process accumulated model usage when resultAggregator exists, including system-error outcomes. The regression test already added to this branch covers failed agent runs.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Summary
SkillInvokerServicecurrently skips credit settlement when an Agent run ends with a system/provider error, even when earlier model calls completed and their token usage was recorded inresultAggregator. The finalizer now processes the recorded usage whenever the aggregator exists, for all terminal outcomes.Added a regression suite covering successful completion, user abort, and a later provider/system error after an earlier successful model call.
Validation
Summary by CodeRabbit
Bug Fixes
Tests