Skip to content

Add Limit Tracker — core 8 (Claude/Codex/Copilot/Cursor/DeepSeek/Gemini/OpenCode Go/z.ai) - #367

Open
pfTheTrial wants to merge 3 commits into
vicinaehq:mainfrom
pfTheTrial:main
Open

Add Limit Tracker — core 8 (Claude/Codex/Copilot/Cursor/DeepSeek/Gemini/OpenCode Go/z.ai)#367
pfTheTrial wants to merge 3 commits into
vicinaehq:mainfrom
pfTheTrial:main

Conversation

@pfTheTrial

Copy link
Copy Markdown

Track AI coding agent limits across 8 providers — Claude, Codex, Copilot, Cursor, DeepSeek, Gemini, OpenCode Go, z.ai — natively via @vicinae/api.

Features:

  • Master-detail list with progress rings, live Resets In (LiveResetLabel), per-model Claude windows, Codex reset-credit bank
  • OpenCode Go 5h/Weekly/Monthly parsed from zen/go/v1/usage (rolling percent) with per-window Resets In, standardized like Claude/Codex
  • Menu-bar mode, TTL cache, refresh debounce/cooldown, toggle via preferences

Checklist:

  • tsc --noEmit OK, 140 tests pass, vici build OK
  • icon limit-tracker-icon.svg, package-lock.json committed, LICENSE MIT, README with banner + preview
  • phase-2 providers moved out of src, deps only @vicinae/api

@clankus-aurelius

clankus-aurelius commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Thanks for contributing an extension to Vicinae! 👋

Before publication, this pull request receives two reviews:

  1. An automated review for extension guidelines, safety, error handling, and likely correctness issues.
  2. A final review from a Vicinae maintainer.

Ready for human review. The automated reviewer approved the latest commit and a maintainer has been notified.

No blocking findings remain on the latest commit.

The automated reviewer examines only the current commit. New commits invalidate its previous decision and start another review.

@clankus-aurelius clankus-aurelius added the ai-reviewing Automated extension review is running label Aug 27, 2026

@clankus-aurelius clankus-aurelius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The PR has one publication blocker and five functional or documentation issues. The most serious problems are bypassing the preferences API and presenting fabricated or inaccessible usage information.


Automated review found 1 publication-blocking issue.

This is an AI-generated first pass and may be mistaken. If a finding is unclear or incorrect, reply in the relevant thread and mention @aurelleb.

Comment on lines +552 to +557
/>
</ActionPanel>
}
>
{baseRows.map((row) => {
if (row.kind === "agent") {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🔴 Blocking — Extension settings bypass the preferences API

Rule: API-001

The action opens the hard-coded vicinae://extension-preferences URL. The authoritative API declares openExtensionPreferences() specifically for this operation.

Suggested resolution: Replace the browser/deeplink action with an action whose handler calls openExtensionPreferences().

Comment on lines +183 to +192
rollingResetsAt = null;
} else {
// Primary is rolling (5-Hour) if present, else first quota
const rQuota = rolling.quota ? { ...rolling.quota, resetsAt: rolling.resetsAt } : null;
primary = rQuota ?? quotas[0];
// Attach correct reset to primary
if (primary && !primary.resetsAt) {
if (primary.label === "5-Hour") primary = { ...primary, resetsAt: rollingResetsAt };
else if (primary.label === "Weekly") primary = { ...primary, resetsAt: weeklyResetsAt };
else if (primary.label === "Monthly") primary = { ...primary, resetsAt: monthlyResetsAt };

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Missing quota data is reported as 100% remaining

Rule: CORRECTNESS-001

When no recognizable quota is returned, the fetcher invents empty 5-hour, weekly, and monthly quotas. These are rendered as healthy 100% remaining instead of an unavailable or parse-error state.

Suggested resolution: Return a parse error when the successful response contains no usable quota data.

Suggested change
rollingResetsAt = null;
} else {
// Primary is rolling (5-Hour) if present, else first quota
const rQuota = rolling.quota ? { ...rolling.quota, resetsAt: rolling.resetsAt } : null;
primary = rQuota ?? quotas[0];
// Attach correct reset to primary
if (primary && !primary.resetsAt) {
if (primary.label === "5-Hour") primary = { ...primary, resetsAt: rollingResetsAt };
else if (primary.label === "Weekly") primary = { ...primary, resetsAt: weeklyResetsAt };
else if (primary.label === "Monthly") primary = { ...primary, resetsAt: monthlyResetsAt };
let primary: OpencodegoQuota | null = null;
if (quotas.length === 0) {
return {
usage: null,
error: { type: "parse_error", message: "OpenCode Go response did not contain usable quota data." },
};
} else {

Comment on lines +281 to +286
<MenuBarExtra.Item
key={agent.id}
icon={agent.icon}
title={getMenuItemTitle(agent.name, agent.accessory.text, agent.isLoading, agent.isOpenCodeActive)}
tooltip={getMenuItemTooltip(agent.accessory.tooltip)}
onAction={() => openCommandPreferences()}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Usage items open preferences instead of details

Rule: CORRECTNESS-001

Provider items advertise “Click to open details,” but their action calls openCommandPreferences(). The separate “Open Agent Usage” item uses the same incorrect handler, so neither action opens usage details.

Suggested resolution: Wire these actions to open the main Agent Usage command or its detail view; reserve openCommandPreferences() for the Configure item.

Comment on lines +592 to +594
const view = row.view;
const accessory = view.getAccessory();
return (

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Multi-account errors omit their actionable message

Rule: UX-001

Accounted Codex and z.ai rows always render metadata. Their error metadata contains only generic status/type fields, hiding messages such as how to add an account or repair credentials.

Suggested resolution: When view.error exists, render formatErrorMarkdown(view.error.message) as done for single-provider rows; render provider metadata only on success.

Comment on lines +507 to +513
await showToast({
title: "Please wait",
message: `Refresh available in ${waitSec}s`,
style: Toast.Style.Animated,
});
return;
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Refresh repeats multi-account provider requests

Rule: CORRECTNESS-001

Refresh iterates rendered account rows, although every row for a provider shares the same revalidate function that refreshes all its accounts. With multiple Codex or z.ai accounts, one refresh therefore refetches the complete provider repeatedly, increasing latency and rate-limit risk.

Suggested resolution: Deduplicate refresh operations by provider or revalidate callback before invoking them.

- **Copilot** — GitHub device flow + internal usage API.
- **Cursor** — Browser session cookies for plan + usage + billing resets.
- **DeepSeek** — API key for credit balance tracking.
- **Gemini** — OAuth-backed quota API using Gemini CLI credentials.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Copilot setup falsely claims a device flow

Rule: MANIFEST-001

The provider documentation promises a GitHub device flow, but the implementation only discovers an existing environment token or accepts a preference token; it does not implement device authorization.

Suggested resolution: Describe the implemented token-based setup, or add the advertised device flow.

Suggested change
- **Gemini**OAuth-backed quota API using Gemini CLI credentials.
- **Copilot**Reads an existing GitHub token from your environment or extension preferences and queries the internal usage API.

@clankus-aurelius clankus-aurelius added ai-changes-requested Automated review found blocking issues and removed ai-reviewing Automated extension review is running labels Aug 27, 2026
@clankus-aurelius clankus-aurelius added ai-reviewing Automated extension review is running and removed ai-changes-requested Automated review found blocking issues labels Aug 27, 2026

@clankus-aurelius clankus-aurelius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One functional issue remains in the menu-bar navigation fix.


Automated extension review passed. A maintainer review is still required.

This is an AI-generated first pass and may be mistaken. If a finding is unclear or incorrect, reply in the relevant thread and mention @aurelleb.

Comment on lines +287 to +302
onAction={() => open("vicinae://extensions/limit-tracker/agent-usage")}
/>
))}
</MenuBarExtra.Section>
<MenuBarExtra.Section>
<MenuBarExtra.Item
title={refreshTitle}
icon={Icon.ArrowClockwise}
shortcut={Keyboard.Shortcut.Common.Copy}
onAction={handleRefresh}
/>
<MenuBarExtra.Item
title="Open Agent Usage"
icon={Icon.List}
shortcut={{ modifiers: ["cmd"], key: "o" }}
onAction={() => open("vicinae://extensions/limit-tracker/agent-usage")}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🟠 Warning — Menu-bar actions use an invalid command deeplink

Rule: CORRECTNESS-001

Both actions open vicinae://extensions/limit-tracker/agent-usage, but the authoritative product reference defines command deeplinks as vicinae://launch/<provider>/<entrypoint>. These actions therefore do not open Agent Usage.

Suggested resolution: Change both URLs to vicinae://launch/limit-tracker/agent-usage.

@clankus-aurelius clankus-aurelius added human-reviewable Automated review passed; ready for maintainer review and removed ai-reviewing Automated extension review is running labels Aug 27, 2026
@clankus-aurelius

Copy link
Copy Markdown
Collaborator

@aurelleb automated review passed for ba8cfba; this extension is ready for your review.

@clankus-aurelius clankus-aurelius added ai-reviewing Automated extension review is running and removed human-reviewable Automated review passed; ready for maintainer review labels Aug 27, 2026

@clankus-aurelius clankus-aurelius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The previous menu-bar deeplink issue is resolved. No new actionable issues were introduced by the incremental changes.


Automated extension review passed. A maintainer review is still required.

This is an AI-generated first pass and may be mistaken. If a finding is unclear or incorrect, reply in the relevant thread and mention @aurelleb.

@clankus-aurelius clankus-aurelius added human-reviewable Automated review passed; ready for maintainer review and removed ai-reviewing Automated extension review is running labels Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

human-reviewable Automated review passed; ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants