Repository navigation
fix: Kiro CLI provider usage parsing and session detection (#367) - #517
Merged
Merged
Conversation
- Support multiple card markers and stderr card prioritization over stdout warnings in KiroCLI - Expand KiroLimits database candidates to ~/.local/share/kiro-cli and support social/external IdP tokens in auth_kv - Make KiroUsage plan name, progress bar, percentage, credit pair, and reset date parsing resilient to case variations, Unicode box borders, and number formatting - Avoid false needsAuth when usage metrics or plan details are successfully parsed
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.
Summary
Resolves #367. Fixes an issue where the Kiro provider could fail to detect a logged-in kiro-cli session or fail to parse usage output from
kiro-cli.Key Changes
Robust stream selection in
KiroCLI:"Estimated Usage"("covered in plan","usage breakdown","Bonus credits","Overages:","KIRO","Kiro","Plan:") so card output in stderr is not discarded when stdout contains stray CLI warnings/logs.~/.cargo/bin/kiro-cliand/usr/bin/kiro-clito binary search locations.Expanded session detection & token resolution in
KiroLimits:~/.local/share/kiro-cli/data.sqlite3and~/.config/kiro-cli/data.sqlite3in addition to~/Library/Application Support/kiro-cli/data.sqlite3.kirocli:social:token) and external IdP tokens (kirocli:external-idp:token) alongside AWS SSO / OIDC tokens (kirocli:odic:token) inauth_kv.Flexible CLI card parsing in
KiroUsage:Kiro Pro,Kiro Free), Unicode box drawing separators (│,┃), and flexible column ordering inEstimated Usage.█,░,■,▓,▒) and ASCII tracks (-,=), general decimal percentages (e.g.12.5%), and zero percent without full block characters.1,000,5,000), decimal totals, and formatting variations.needsAuthtrigger when valid plan or usage metrics are parsed even if a hint in the CLI output mentionskiro-cli login.Test Plan
KiroUsageTestscovering title-case plans, Unicode box borders, decimal percentages, thousands commas, and login hint resilience.KiroCLITestsverifying non-"Estimated Usage" cards in stderr win over stdout warnings.KiroLimitsTestsverifying social login token loading and~/.local/sharedatabase discovery.