Skip to content

ocx provider quota prints only a report count, dropping every fetched quota bar #2565

Closed

Description

@lidge-jun

Client or integration

CLI

Area

CLI

Summary

ocx provider quota prints only a two-line stub instead of the quota bars it fetches. Every other quota surface renders percentages and reset times; this one collapses the whole report to a count.

$ ocx provider quota
generatedAt: 1787668202536
reports: 5 item(s)

The data is present — ocx provider quota --json returns full fiveHourPercent / weeklyPercent / customWindows rows for openai, anthropic, xai, cursor, and google-antigravity. Only the human-readable projection is lost, so the default invocation of the command is useless for its stated purpose and users have to pipe JSON through a parser to read their own quota.

Root cause is a formatter mismatch, not a data problem. quota() in src/cli/provider-runtime.ts:110 renders the response with the generic summaryLines() helper from src/cli/runtime-api.ts:294. That helper is a depth-1 flattener: at line 300-301 it detects that reports is a non-scalar array and emits ${label}: ${child.length} item(s) rather than descending into it. So the count is printed and all five reports are discarded.

A correct per-report renderer already exists a few files away: quotaParts() and providerQuotaLine() in src/cli/account-extended.ts:267-283 format exactly these fields (5h / weekly / monthly / custom windows, each with an ISO reset), and ocx account refresh <provider> uses it today with the expected output:

$ ocx account refresh anthropic
anthropic 5h 5% resets 2026-08-25T16:39:59.640Z weekly 98% resets 2026-08-26T01:59:59.640Z

ocx provider quota should produce one such line per report instead of the array count.

Reproduction

  1. Configure at least one provider whose quota probe succeeds (for example anthropic with an OAuth login).
  2. Run ocx provider quota.
  3. Observe two lines: generatedAt: <epoch ms> and reports: N item(s). No provider name, no percentage, no reset time.
  4. Run ocx provider quota --json and observe that the same call returns complete quota objects for every provider.
  5. Run ocx account refresh anthropic and observe the formatted line the text mode should have produced.

--refresh behaves identically; the stub is independent of cache state.

Expected behavior:

  • text mode prints one line per report, provider-labeled, with each present window's percent and reset time, reusing the quotaParts() formatting already shipped for ocx account refresh;
  • a report with no readable bars prints an explicit unavailable marker rather than being silently dropped;
  • --json output is unchanged.

Version

@bitkyc08/opencodex 2.32.0; confirmed in source at origin/dev@e1fb6755951c82fc0fc137820d2b40208d79e918.

Operating system

macOS 27.0. The defect is a pure output-formatting path and is platform-independent.

Provider and model

Reproduced with anthropic (OAuth), but the stub is provider-independent — it drops the whole reports array regardless of which providers populate it.

Logs or error output

$ ocx provider quota
generatedAt: 1787668202536
reports: 5 item(s)

$ ocx provider quota --json | head -20
{
  "generatedAt": 1787668207001,
  "reports": [
    {
      "provider": "anthropic",
      "label": "Anthropic Claude",
      "source": "anthropic:oauth-usage",
      "quota": {
        "fiveHourPercent": 5,
        "weeklyPercent": 98,
        "updatedAt": 1787668206828
      }
    }
  ]
}

Screenshots and supporting files

Not applicable; the output is reproduced verbatim above and the defect is deterministic.

Redacted configuration

{
  "providers": {
    "anthropic": {
      "adapter": "anthropic",
      "baseUrl": "https://api.anthropic.com",
      "authMode": "oauth"
    }
  }
}

Checks

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

Activity

  1. added
    bug
    account-pool
    cli
    on Aug 25, 2026
  2. lidge-jun commented on Aug 25, 2026

    @lidge-jun
    OwnerAuthor

    리뷰 · 우선순위 64 / 80

    설명: 이 이슈는 ocx provider quota 가 가져온 막대를 버리고 개수만 찍는다고 한다. 작성자는 lidge-jun 이다. 지금 열려 있다. 라벨은 bug, account-pool, cli 다. 지금 CURRENT dev HEAD 는 e1fb675 이다. 이번 시간에 SHA 는 안 움직였다. origin/dev package.json 은 2.32.1-preview.20260825 다. 본문이 그 SHA 를 적는다. 차량 풀은 아직 없다. 내가 구현하지 않고 머지하지 않는다.

    HEAD 에서 원인 지적은 맞다. src/cli/provider-runtime.ts 105-112줄 quota() 는 /api/provider-quotas 를 받은 뒤 printData 에 summaryLines(result) 를 넘긴다. src/cli/runtime-api.ts 294-308줄 summaryLines 는 깊이 1 평탄기다. 299-301줄에서 reports 가 스칼라가 아닌 배열이면 자식으로 내려가지 않고 reports: N item(s) 한 줄만 남긴다. generatedAt 은 숫자라 그대로 찍힌다. 그래서 본문이 보여 준 두 줄이 나온다. --json 은 printData 가 원본을 그대로 찍으므로 데이터가 있다. --refresh 도 같은 formatter 를 쓰므로 캐시와 무관하다.

    이미 있는 렌더러가 가깝다. src/cli/account-extended.ts 267-280줄 quotaParts 는 5h, weekly, monthly, customWindows 를 퍼센트와 ISO 리셋으로 이어 붙인다. 282-283줄 providerQuotaLine 은 공급자 이름을 앞에 붙인다. ocx account refresh 가 그 줄을 쓴다. 이 이슈가 바라는 텍스트 모드는 그 줄을 보고서마다 한 줄씩 찍는 것이다. 막대가 없으면 조용히 지우지 말고 없음을 밝혀야 한다. --json 은 바꾸지 말 것.

    이 구멍은 포맷만의 버그다. 프록시 쿼터 프로브는 살아 있다. 2566 은 계정마다 같은 숫자를 리스트에 보여 달라는 기능이다. 그 기능은 이 렌더러를 재사용하는 편이 맞다. 다만 2566 을 이 이슈로 닫지 말 것. 2539 는 라우터가 주간 창을 고르는 일이다. 이 이슈로 닫지 말 것. 2557 은 윈도 파워셸 생성이다. 닫지 말 것. 2558 은 fastwire 등급이다. 닫지 말 것.

    src/runtime 은 없다. default-aliases.ts 와 model-presets.ts 도 없다. 2463 2464 2465 를 닫지 말 것. 프리뷰 배포가 아니다. 태그하지 말 것. 배포하지 말 것. 내가 이 이슈를 닫지 않는다.

    라인 110 - src/cli/provider-runtime.ts quota() 가 summaryLines 로 보고서를 접는다
    라인 301 - src/cli/runtime-api.ts summaryLines 가 객체 배열을 개수로만 찍는다
    라인 267 - src/cli/account-extended.ts quotaParts 가 이미 막대 문자열을 만든다
    라인 282 - src/cli/account-extended.ts providerQuotaLine 이 공급자 이름을 붙인다
    2566 - 계정별 표시다. 이 이슈로 닫지 말 것. 고친 렌더러를 재사용할 수 있다
    2539 - 라우팅 창 선택이다. 표시와 다르다. 닫지 말 것

    메인테이너의 판단이 필요한 지점

    • 이 이슈를 받을지. 받는 편이 맞다. HEAD 경로가 본문과 같다
    • 차량을 따로 둘지. 포맷만 고치는 작은 풀이면 된다. 내가 만들지 않는다
    • 2566 과 한 풀로 묶을지. 묶지 않는 편이 낫다. 이 이슈는 활성 보고서 텍스트다. 2566 은 계정 리스트 플래그다
    • 2539 를 같이 닫을지. 닫지 말 것
    • 지금 leftover-close 할지. 차량이 없다. 내가 닫지 않는다

    너의 추천
    버그로 받는다. quota() 텍스트 모드만 providerQuotaLine 으로 바꾸고 --json 은 그대로 둔다. 막대가 없는 보고서는 없음을 찍는다. 내가 구현하지 않는다. 2566 과 2539 는 이 이슈로 닫지 말 것. 라벨은 그대로 둔다. 프리뷰 배포가 아니다.

    이 댓글은 grok-bot이 작성했습니다

  3. lidge-jun commented on Aug 25, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev in #2586.

    Your diagnosis was exact: summaryLines() is a depth-1 flattener, so the reports array became N item(s) and every fetched report was discarded. It now renders through providerQuotaLine, the same formatter ocx account refresh uses, so both commands agree.

    Verified against a live proxy — ocx provider quota now prints one bar line per provider (openai, anthropic, xai, cursor with its custom windows, google-antigravity) instead of the two-line stub.

    I left the percentage precision alone: ocx account refresh prints the same raw values, so changing the shared formatter is a separate decision from repairing a dropped projection.

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-poolbugcli

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions