Skip to content

fix(agent): forward AionRS provider token usage - #808

Open
minhtq1234 wants to merge 1 commit into
iOfficeAI:mainfrom
minhtq1234:codex/bug015-provider-usage-v0150
Open

fix(agent): forward AionRS provider token usage#808
minhtq1234 wants to merge 1 commit into
iOfficeAI:mainfrom
minhtq1234:codex/bug015-provider-usage-v0150

Conversation

@minhtq1234

Copy link
Copy Markdown

Summary

  • forward AionRS provider input/output token totals on successful finish events
  • convert cumulative engine counters into per-turn deltas, including resumed sessions
  • preserve optional-field compatibility through the event sink and WebSocket relay

Why

WePrompt's local token ledger receives finish events, but AionRS previously discarded AgentResult.usage and emitted a finish event without counters. Real Kimi turns therefore left Today / Week / Month totals at zero.

Verification

  • cargo fmt --all -- --check
  • cargo clippy -p aionui-ai-agent -p aionui-conversation --all-targets -- -D warnings
  • cargo test -p aionui-ai-agent -p aionui-conversation
  • CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 just push -u contributor codex/bug015-provider-usage-v0150 — 8,366 passed, 24 skipped
  • live Kimi K3 smoke in WePrompt: provider counters reached the local ledger, appeared in the usage popover, and survived renderer reload

Compatibility

The new finish-event fields are optional and omitted when no provider counters advance. Existing ACP and older consumers remain compatible.

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