Skip to content

Doubao: surface Coding Plan usage (session/weekly/monthly) via GetCodingPlanUsage instead of "Limits not available" #1724

Description

@LeoLin990405

Summary

After #1382 / #1454, Doubao correctly stops showing a false "100% used" and instead shows "Limits not available" — because the Volcano Ark bearer key exposes no usage at all. But the data does exist: the Ark Coding Plan usage is available via a Volcengine OpenAPI whose shape maps 1:1 onto CodexBar's existing session/weekly/monthly windows. This issue proposes surfacing it.

Why "Limits not available" happens (confirmed)

Probing POST ark.cn-beijing.volces.com/api/coding/v3/chat/completions (and the standard /api/v3) with the ARK_API_KEY returns HTTP 200 but no x-ratelimit-* headers (only x-request-id). So requestLimitsReliable is always false → "Limits not available". There is no bearer-key endpoint that returns Ark request limits.

The data does exist — GetCodingPlanUsage

The console's 开通管理 → subscribe tab calls the Ark Top OpenAPI GetCodingPlanUsage (Service=ark, Version=2024-01-01). Response shape (values neutralised):

{
  "Status": "Running",
  "UpdateTimestamp": 0,
  "QuotaUsage": [
    { "Level": "session", "Percent": 0.0, "ResetTimestamp": 0 },
    { "Level": "weekly",  "Percent": 0.0, "ResetTimestamp": 0 },
    { "Level": "monthly", "Percent": 0.0, "ResetTimestamp": 0 }
  ]
}

That is exactly CodexBar's model: each Level → a RateWindow(usedPercent:, resetsAt:), the same way Claude/Codex coding plans render session/weekly/monthly. (Subscription presence is confirmable via ListSubscribeTradeResourceType: "CodingPlan".)

Proposal

For Doubao Coding Plan keys, fetch GetCodingPlanUsage and map session → primary, weekly → secondary, monthly → tertiary, replacing "Limits not available" with real usage bars.

Caveat (raising as an issue first, not a PR)

GetCodingPlanUsage is a Volcengine OpenAPI requiring AK/SK V4 request signing — distinct from the existing ARK_API_KEY bearer credential. So this needs a new credential type (Volcengine AccessKey/SecretKey) + the Volc V4 signature, which is a product decision. If you're open to adding an AK/SK credential for Doubao, I'm happy to implement (provider fetcher + signing + settings UI + tests).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions