-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Doubao: surface Coding Plan usage (session/weekly/monthly) via GetCodingPlanUsage instead of "Limits not available" #1724
Copy link
Copy link
Open
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper 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 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 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.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P2Normal priority bug or improvement with limited blast radius.Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper 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 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 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.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.This issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
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 theARK_API_KEYreturns HTTP 200 but nox-ratelimit-*headers (onlyx-request-id). SorequestLimitsReliableis always false → "Limits not available". There is no bearer-key endpoint that returns Ark request limits.The data does exist —
GetCodingPlanUsageThe 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→ aRateWindow(usedPercent:, resetsAt:), the same way Claude/Codex coding plans render session/weekly/monthly. (Subscription presence is confirmable viaListSubscribeTrade→ResourceType: "CodingPlan".)Proposal
For Doubao Coding Plan keys, fetch
GetCodingPlanUsageand mapsession → primary,weekly → secondary,monthly → tertiary, replacing "Limits not available" with real usage bars.Caveat (raising as an issue first, not a PR)
GetCodingPlanUsageis a Volcengine OpenAPI requiring AK/SK V4 request signing — distinct from the existingARK_API_KEYbearer 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).