Skip to content

Alibaba Token Plan (Personal/Solo, Singapore ap-southeast-1) — quota not parsed; auth succeeds but body parser returns null #2349

Description

@halilertekin

Problem

The alibaba-token-plan provider in CodexBar detects the login cookie correctly and reaches modelstudio.console.alibacloud.com over HTTPS, but the parsed usage is always primary=null, secondary=null, tertiary=null. Only loginMethod=TOKEN PLAN is exposed, so the menubar widget shows "Plan: Token Plan" without any quota/reset windows.

This is distinct from #612 (which is about alibaba-coding-plan INTL users with no auth path). This issue is about alibaba-token-plan for Singapore Personal/Solo subscriptions, where auth works but quota parsing does not.

Environment

  • CodexBar: latest stable (menubar build, macOS 14+)
  • Account: Alibaba Cloud International (INTL) Singapore workspace
  • Plan: Token Plan — Personal/Solo edition (not Coding Plan, not Team edition)
  • Region: ap-southeast-1
  • Authentication: Chrome Default profile cookies on modelstudio.console.alibabacloud.com (Section "Alibaba Token Plan")
  • API key (sk-sp-H.RIXR.{signature}): confirmed valid for inference endpoint https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic/v1/messages (returns 200 OK), but token-plan team endpoint (sfm_tokenplanteams_dp_cn ProductCode) rejects it.

Symptoms

codexbar usage --provider alibaba-token-plan --json returns:

[
  {
    "provider": "alibabatokenplan",
    "source": "web",
    "usage": {
      "loginMethod": "TOKEN PLAN",
      "secondary": null,
      "tertiary": null,
      "updatedAt": "2026-07-20T02:24:04Z",
      "primary": null,
      "identity": {
        "providerID": "alibabatokenplan",
        "loginMethod": "TOKEN PLAN"
      }
    }
  }
]

Verbose log (--log-level trace) confirms:

apiHost=modelstudio.console.alibacloud.com dashboardCookieNames=[…27 cookies including login_aliyunid, hsite…] hasCSRF=1 region=intl secTokenSource=resolved
bodyBytes=409 contentType=application/json;charset=UTF-8 status=200

So the request succeeds (HTTP 200, sec_token resolved, region=intl) but the 409-byte JSON body does not contain the TotalValue/TotalSurplusValue/TotalCount fields that CodexBar's parser expects.

Root cause hypothesis

CodexBar's GetSubscriptionSummary call targets the China mainland Team-edition SKU (sfm_tokenplanteams_dp_cn ProductCode + region=cn-beijing hard-coded). Singapore Personal/Solo edition returns a different subscription summary payload (different field names, different SKU, different region). The cookie auth is reached correctly — only the SKU/region/hard-coded query params and the JSON shape parser need to be Personal/Solo + ap-southeast-1 aware.

Suggested fix (medium-term)

  1. Detect Singapore Personal SKU from cookie/dashboard HTML and switch the ProductCode and region=ap-southeast-1 query params.
  2. Make the JSON parser tolerant of alternative field names returned by the Personal/Solo subscription summary (usedQuota, totalQuota, quota, etc. — whatever the live payload shape is).
  3. Alternatively, surface a clear "Quota parse unavailable for Personal edition" label instead of silently emitting primary=null so users know the issue is on the parser side, not their account.

Reproduction

# 1. Enable Alibaba Token Plan in CodexBar Settings → Providers.
# 2. Ensure Chrome is signed in to https://modelstudio.console.alibacloud.com/ap-southeast-1/
# 3. From terminal:
codexbar usage --provider alibaba-token-plan --json
# Result: usage.primary/secondary/tertiary all null despite loginMethod=TOKEN PLAN.

Workaround

Until this is fixed, Singapore Personal Token Plan subscribers must manually track quota in the Alibaba Cloud console: https://modelstudio.console.alibacloud.com/ap-southeast-1/?tab=globalset#/efm/coding_plan

Related

Activity

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

    P2Normal priority bug or improvement with limited blast radius.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions