Skip to content

bug(gui): WorkBuddy AI quota/credits missing from top QuotaSummaryBar despite successful probe #8131

Closed

Description

@xiangsheng

Client or integration

OpenCodex dashboard

Area

Dashboard

Summary

When workbuddy-ai is configured and successfully authenticated, its credit balance (workbuddyCredits) is parsed by the backend probe (src/providers/quota/workbuddy.ts) and rendered correctly in the provider accounts tab (WorkBuddyCredits.tsx).

However, the topbar quota summary (QuotaSummaryBar) never displays a chip for WorkBuddy AI. This happens because summaryWindows() in gui/src/quota-summary.ts only extracts standard time-window limits (5h, weekly, monthly, customWindows) and creditsUsd. It ignores workbuddyCredits, causing pickHeadline() to find zero measured windows and dropping the provider from the summary bar entirely.

Additionally, this is not caused by any display cap: QuotaSummaryChips supports arbitrary numbers of providers with horizontal overflow and paging controls (« / »).


Environment

  • Version: opencodex v2.96.0 (and main)
  • Component: gui/src/quota-summary.ts, gui/src/components/quota-summary-bar/QuotaSummaryBar.tsx
  • Provider: workbuddy-ai

Root Cause Analysis

  1. Backend representation:
    fetchWorkBuddyQuota() (src/providers/quota/workbuddy.ts) returns:

    quota: {
      updatedAt,
      workbuddyCredits: { total, used, remaining, frozen, groups, expiring }
    }

    Notice that it does not provide creditsUsd, nor does it emit standard percentage windows like weeklyPercent.

  2. GUI report mapping:
    In gui/src/provider-workspace/report.ts:
    quotaFromUnknown() normalizes workbuddyCredits, so accountQuotaFromReport(report) successfully returns an AccountQuota object containing workbuddyCredits.

  3. Summary bar extraction gap:
    In gui/src/quota-summary.ts:

    function summaryWindows(quota: AccountQuota): QuotaSummaryWindow[] {
      const windows: QuotaSummaryWindow[] = quotaWindows(quota).map(...);
      const credits = quota.creditsUsd;
      if (credits && credits.unlimited !== true && finite(credits.percent)) {
        windows.push({
          id: "quotaSummary.credits",
          labelKey: "quotaSummary.credits",
          percent: credits.percent,
          ...
        });
      }
      return windows;
    }
    • quotaWindows(quota) only checks fiveHourPercent, weeklyPercent, monthlyPercent, and customWindows.
    • summaryWindows() checks quota.creditsUsd, but does not check quota.workbuddyCredits.
    • As a result, for WorkBuddy AI, windows is empty.
    • pickHeadline(windows) returns undefined.
    • buildQuotaSummary() executes if (!headline) continue; and omits WorkBuddy AI from the topbar chip list.

Expected Behavior

A chip for WorkBuddy AI appears in the topbar (e.g. showing used/remaining percentage or calculated usage severity), with popover details showing credit status.

Actual Behavior

No chip is rendered in the topbar for WorkBuddy AI, even if other providers (e.g. OpenAI, Anthropic, xAI) show up normally.


Suggested Fix

In gui/src/quota-summary.ts, adapt quota.workbuddyCredits inside summaryWindows():

const wb = quota.workbuddyCredits;
if (wb && finite(wb.total) && wb.total > 0 && finite(wb.used)) {
  const percent = Math.min(100, Math.max(0, (wb.used / wb.total) * 100));
  const expiresMs = wb.expiring?.at ? resetTimestamp(wb.expiring.at) : null;
  windows.push({
    id: "quotaSummary.credits",
    labelKey: "quotaSummary.credits",
    percent,
    ...(expiresMs !== null ? { resetAt: expiresMs } : {}),
    severity: quotaSeverity(percent),
  });
}

This allows WorkBuddy AI credits to derive a valid headline percentage and participate in the QuotaSummaryBar like other credit-based providers.

Reproduction

  1. Configure and log into workbuddy-ai via OAuth (ocx login workbuddy-ai or GUI).
  2. Open the GUI and check Providers -> WorkBuddy AI -> Accounts. Confirm that credits (total, remaining, expiring) are displayed.
  3. Observe the topbar QuotaSummaryBar.

Version

2.96.0

Operating system

OS: Manjaro Linux (x86_64) Kernel: Linux 7.2.9-1-MANJARO

Provider and model

workbuddy-ai

Logs or error output

Screenshots and supporting files

No response

Redacted configuration

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Nov 3, 2026
  2. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  3. added
    account-pool
    gui
    on Nov 3, 2026
  4. github-actions commented on Nov 3, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  5. Ingwannu commented on Nov 4, 2026

    @Ingwannu
    Owner

    Confirmed on current dev (72e80d2). summaryWindows() in gui/src/quota-summary.ts (L57-84) builds windows only from quotaWindows() and creditsUsd. A WorkBuddy report carries only workbuddyCredits (src/providers/quota/workbuddy.ts:79, normalized in gui/src/provider-workspace/report.ts:177-179), so pickHeadline() returns nothing and buildQuotaSummary() skips the provider (L111). The balance is rendered only by ProviderCapacityQuota.tsx (Overview/Accounts), which matches the scope of #7604. It is not a regression.

    This needs a design decision before a fix. structure/providers/workbuddy.md defines these credits as display-only, so credit exhaustion does not disable free models. A header chip that turns warn/critical at 70/90% could suggest the provider is blocked. If we add it, the percent should be (total - remaining) / total rather than used / total, so frozen credits are counted. We also need to decide whether the chip gets threshold severity or stays neutral. A regression case belongs in gui/tests/quota-summary.test.ts. Leaving this for the GUI owner to decide on the presentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolbuggui

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions