Repository navigation
feat(provider-kiro): Usage shows Kiro credits - #27619
Closed
pedrocostadev wants to merge 3 commits into
Closed
pedrocostadev wants to merge 3 commits into
pedrocostadev wants to merge 3 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]>
Kiro reader resolves ~/.kiro via HostProcess.HomeDirectory; test read real home. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
|
Note Written by dry-run draft, no action taken. closure is warranted under the prior approval rule. The PR adds Kiro historical credit accounting, contract fields and web/mobile billing presentation; discussion #27621 leaves design questions open and the body states there is no maintainer approval. Obtain maintainer agreement on the credit-accounting schema and presentation in #27621 and link the approved scope; draft status does not defer this requirement. |
brandonvincitore
added a commit
to brandonvincitore/t3code
that referenced
this pull request
Nov 9, 2026
Add native workspace discovery, MCP reconnection controls, native session ownership guards, Specs, Powers, memory, account-priced titles, and credit history. This checkpoint is pending combined validation. Credit history adapted from pingdotgg#27619 (e4dac3c). Co-authored-by: Pedro Costa <[email protected]>
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
Proposal and open design questions: #27621. No maintainer approval yet. This stays a draft until it lands.
Stacked on #14693 (
v2/kiro-acp). Gap first reported in #14693 (comment). Replaces #27023, which was closed for missing screenshots.Screenshots
Same real history, Usage → Cost → 30 days. Before is
ea359d5(v2/kiro-acp), after is this branch. Isolated dev server (--home-dir /tmp/...), iPhone 17 Pro simulator (iOS 26.2).Web
After: a Kiro provider row shows "7.13 credits · Billed in credits · no token data", and the three Kiro models show credits in the Cost column. The dollar total and the chart are unchanged.
Mobile
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.ts: two tests fail locally on macOS and also fail on the base branch, because macOS reports temp folders under/private. The accounts test now fakes the home directory, so it no longer reads a real~/.kiro.claudeSystemAppendBytes: 5135 -> 5258. That growth comes fromv2/kiro-acpcompared withmain, not from this PR, which doesn't touch agent context. It clears when the base branch picks upmain.Done with Claude Opus 5.5 in Claude Code (T3 Code).
🤖 Generated with Claude Code