Repository navigation
feat(provider-kiro): Usage shows Kiro credits - #27023
Closed
pedrocostadev wants to merge 2 commits into
Closed
pedrocostadev wants to merge 2 commits into
pedrocostadev wants to merge 2 commits into
Conversation
Kiro history has no token counts, only credits per turn. Adds kiro to Usage with an optional credits field on records and buckets, a transcript reader over ~/.kiro/sessions that follows model-switch notes, and credits display on web and mobile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
closing at @StiensWout's request under Provide evidence for the changed behavior. Adds Kiro credits to the web/mobile Usage provider row and model breakdown. The author explicitly promises screenshots before marking the draft ready, but the policy applies equally to drafts and no web/mobile before/after images are attached. submission evidence: "No web or mobile screenshots yet. I'll add them before marking this ready." Attach clear before/after screenshots showing Kiro credits in the affected web and mobile Usage views. thanks for trying to help improve t3 code. if you think this closure was a mistake, please open a fresh pr addressing the requirement above, and link back to this one. |
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.
Problem
Kiro turns don't appear in Usage. Kiro's local history has no token counts, only the credits it billed per turn, and Usage records require token totals with a USD-only cost.
Change
kiroinUsageProviderKind, and an optionalcreditsonUsageRecordandUsageBucket. No contract version bump: older clients skip the unknown provider.packages/provider-kiro/src/server/usage.tsreads~/.kiro/sessions/*/sess_*/messages.jsonl(V3 engine, which T3 runs).usage_summarybecomes one record with its credits and no tokens.agent_note.session.jsonkeeps only the last model, so it would misattribute turns after a switch.executionId.state.initialnow receives the file path, so the session id can come from the directory.unpricedeven when the model has a known rate, so they never show as $0.kiroentries.docs/user/usage.md.Kiro's credits stay out of token totals, cost estimates and the daily chart. The legacy
~/.kiro/sessions/cli/sessions aren't read.Scope and approval
Stacked on #14693 (
v2/kiro-acp). Gap reported in #14693 (comment), with open design questions there:creditsfield vs a generic{ unit, amount }.cli/sessions.Draft until those are answered.
Verification
usageTranscriptStreaming.test.ts: Kiro credits follow a mid-session model switch after large content.usageScanCache.test.ts: a Kiro record round-trips through the cache with its credits.usagePricing.test.ts: credits at a known rate stay unpriced.usageAggregation.test.ts: credits are summed, and the bucket stays unpriced.~/.kiro/sessions. 32 billed turns and 7.13 credits, split acrossclaude-opus-5.5,claude-haiku-4.5andclaude-sonnet-4.5. This matches a directjqsum over the same files.UsageService.test.tsfails locally on 3 tests:/private.~/.kiroon the machine. CI has no~/.kiro.Done with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code