Skip to content

fix: Z.AI V3 coding plans report CREDIT_LIMIT, so the ZAI adapter always shows "invalid ZAI usage" #97

Description

@BorisStricky

Description

Repro: Any Z.AI account on a newer V3 plan (Lite/Pro, GLM-5 era). Valid API key; the endpoint returns 200 and real usage, but the sidebar ZAI block renders "invalid ZAI usage". Verified 2026-09-02 against the live endpoint.

Root cause: zaiWindowFromLimit in src/providers/zai.ts only recognizes TOKENS_LIMIT (→ 5h rolling window) and TIME_LIMIT (→ tier). Z.AI's quota API now returns CREDIT_LIMIT entries for credit-based plans

Providers

ZAI

Plugin version

1.6.1

OpenCode version

1.18.23

OS

Linux

Steps to reproduce

Install the plugin in opencode connected to Z.ai provider

Expected behavior

Shows correct z.ai usage

Actual behavior

Shows "invalid ZAI usage"

Config

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions