Skip to content

Conversation

@kilhyeonjun
Copy link

Summary

Fixes #287

kiro-cli 1.24.1 changed its output format due to AWS Q Developer rebranding. This PR adds support for the new format.

Changes

  • Add parsing for new Plan: X format from kiro-cli 1.24+
  • Handle managed by admin cases for enterprise/Pro plans
  • Add isUsageOutputComplete checks for new format
  • Add 3 test cases covering Q Developer plan formats

Old Format (kiro-cli < 1.24)

| KIRO FREE                                          |
████████████████████████████████████████████████████ 25%
(12.50 of 50 covered in plan), resets on 01/15

New Format (kiro-cli 1.24+)

Plan: Q Developer Pro
Your plan is managed by admin

Tip: to see context window usage, run /context

Testing

Added 3 new test cases:

  • parsesQDeveloperManagedPlan() - Tests "Plan: Q Developer Pro" with "managed by admin"
  • parsesQDeveloperFreePlan() - Tests "Plan: Q Developer Free"
  • parsesNewFormatWithANSICodes() - Tests ANSI escape code handling

- Add parsing for new 'Plan: X' format from kiro-cli 1.24+
- Handle 'managed by admin' cases for enterprise plans
- Add isUsageOutputComplete checks for new format
- Add 3 test cases for Q Developer plan formats

Fixes steipete#287
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c229d803b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 459 to 462
// Require at least one key pattern to match to avoid silent failures
if !matchedPercent, !matchedCredits {
if !matchedPercent, !matchedCredits, !matchedNewFormat {
throw KiroStatusProbeError.parseError(
"No recognizable usage patterns found. Kiro CLI output format may have changed.")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject new-format output that lacks usage data

Because matchedNewFormat now bypasses the “no recognizable usage patterns” error, any output that only contains a Plan: line but omits usage/credits (and does not include the “managed by admin” marker) will be treated as valid and fall back to the default creditsTotal = 50. This means a Q Developer Pro (or any paid) plan that emits the new header-only format will be reported as 0/50 free-tier usage, which is inaccurate. Consider keeping the parse error unless you also saw usage data, or explicitly mark the snapshot as unknown instead of using the free-tier default.

Useful? React with 👍 / 👎.

Address review feedback: only bypass parse error for managed plans
that don't expose usage data. Non-managed plans with Plan: header
but no usage data will now correctly throw parse error instead of
falling back to default 50 credits.
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.

Kiro CLI 1.24+ output format change breaks usage parsing

1 participant