Add Kimi usage TUI command#5
Open
ooojustin wants to merge 2 commits intolemon07r:masterfrom
Open
Conversation
There was a problem hiding this comment.
5 issues found across 12 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/auth-refresh.ts">
<violation number="1" location="src/auth-refresh.ts:64">
P2: Swallows all lock-state filesystem errors and turns them into a generic timeout, hiding real path/permission failures.</violation>
<violation number="2" location="src/auth-refresh.ts:75">
P1: Refresh lock is not owner-safe; stale lock deletion and unconditional cleanup can remove another process’s active lock and break mutual exclusion.</violation>
</file>
<file name="src/tui.tsx">
<violation number="1" location="src/tui.tsx:123">
P2: Async dialog flow has no cancellation/staleness guard, so older or dismissed requests can still replace the UI when they finish.</violation>
</file>
<file name="src/usage.ts">
<violation number="1" location="src/usage.ts:81">
P2: Immediate-reset countdown values are dropped because `0` is treated as absent.</violation>
</file>
<file name="package.json">
<violation number="1" location="package.json:50">
P1: Exported TUI entrypoint depends on packages that are only in devDependencies, so consumers can hit module-resolution failures.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
There was a problem hiding this comment.
2 issues found across 7 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/auth-refresh.ts">
<violation number="1" location="src/auth-refresh.ts:61">
P1: Rewriting the owner file in place can corrupt it during cleanup, causing `ownsLock()` to return false and skip removing the refresh lock directory.</violation>
<violation number="2" location="src/auth-refresh.ts:133">
P2: Uncaught lock cleanup errors can make a successful refresh fail.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
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.
Changes
/kimi:usageas a TUI slash command./coding/v1/usagesendpoint.Preview
Summary by cubic
Adds a TUI slash command
/kimi:usageto show Kimi Code subscription usage using stored OAuth with a safe, multi-session refresh. It renders weekly and 5h limits in a compact modal with progress bars and reset hints.New Features
/kimi:usagefetches usage and displays weekly and 5h limits with progress bars, reset hints (including “reset now”), and loading/empty states (esc to close).ensureFreshStoredAuthand added focused parser and auth-refresh tests.Dependencies
@opentui/coreand@opentui/solid; enabledtsx/Solid JSX in tsconfig../tuipackage export.Written for commit 0b7142f. Summary will update on new commits.