Skip to content

Improve Kiro provider catalog, usage tracking, and TUI integration#96

Draft
garysassano wants to merge 3 commits into
tickernelz:masterfrom
garysassano:pr/kiro-provider-tui-usage
Draft

Improve Kiro provider catalog, usage tracking, and TUI integration#96
garysassano wants to merge 3 commits into
tickernelz:masterfrom
garysassano:pr/kiro-provider-tui-usage

Conversation

@garysassano
Copy link
Copy Markdown
Contributor

@garysassano garysassano commented May 23, 2026

Visual preview

image

User-facing changes

  • Adds a separate OpenCode TUI plugin entrypoint (./tui) with a Kiro sidebar panel.
  • Shows Kiro account state only for Kiro sessions.
  • Removes the login-time Kiro usage popup now that the sidebar carries the useful state.
  • Aligns the default model catalog with the official Kiro CLI model list.
  • Removes advertised OpenCode-only model variants from the Kiro model metadata, so Opus/Sonnet no longer show fake low, medium, high, max, or xhigh variants.
  • Keeps legacy model aliases resolvable where possible without advertising them as supported defaults.

Usage and quota fixes

  • Matches the official kiro-cli /usage behavior by reading currentUsageWithPrecision / usageLimitWithPrecision from getUsageLimits.
  • Tries the KIRO_CLI usage origin first, with fallback to existing AI editor credits shapes.
  • Stores quota columns as REAL so fractional credit usage is preserved.
  • Stops incrementing usedCount locally during account selection.
  • Prevents stale or same-timestamp integer quota snapshots from overwriting newer precise remote quota values.
  • Preserves the fully qualified plan name returned by Kiro, e.g. KIRO PRO+.

Auth and provider integration

  • Adds OpenCode auth placeholder support so Kiro appears correctly in OpenCode auth/provider flows.
  • Improves IAM Identity Center handling with profile ARN support and OIDC client credential caching.
  • Carries subscription plan and precise usage through auth, CLI sync, account repository, and TUI read paths.
  • Keeps the legacy kiro-auth provider ID bridge while using kiro as the primary provider ID.

Streaming and credits handling

  • Centralizes thinking stream parsing so reasoning is emitted before final answer text and handles split <thinking> tags correctly.
  • Adds SDK endpoint fallback handling for socket failures while avoiding fallback for real quota/throttling errors.
  • Keeps explicit reasoning options supported at credits time without advertising non-Kiro variant UI metadata.

Packaging and docs

  • Adds a Solid/OpenTUI build step for the TUI bundle.
  • Exposes separate package exports for the server plugin and TUI plugin.
  • Adds hot-swap/restore helper scripts for local OpenCode plugin verification.
  • Adds documentation for the TUI usage panel and a production readiness summary.

@tickernelz
Copy link
Copy Markdown
Owner

Looks like this PR is still actively changing — I noticed another commit landed after review started.

To avoid reviewing/merging a moving target, can you mark this PR as Draft while you’re still iterating? Once the implementation is stable, please switch it back to Ready for review or comment here, and I’ll do the final merge-readiness review then.

@garysassano garysassano marked this pull request as draft May 23, 2026 05:00
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.

2 participants