Add Zed token spend and plan limits to integration
Summary
Please expand the Zed integration to include token spend information and plan limits, so usage can be tracked without opening the Zed account page.
Motivation
CodexBar is great for quick usage visibility across providers. Adding Zed token spend + limits would make Zed usage equally visible in the menu bar and help avoid unexpected overages.
Reference
Zed pricing/plans docs: https://zed.dev/docs/account/plans-and-pricing
Requested behaviour
- Show Zed Token Spend in CodexBar.
- Show Zed limit/quota (where available from Zed data source).
- Show remaining amount (limit - spend), if both values are available.
- If limit data is unavailable, still show spend and a clear “limit unavailable” state.
Suggested UI
- In the Zed section, display:
- Spent
- Limit
- Remaining
- Billing/usage period (if available)
Implementation notes (suggestion)
- Add a typed model for Zed usage fields (spent, limit, remaining, period).
- Keep parsing resilient to missing/partial fields.
- Add tests for:
- successful parsing
- missing limit
- malformed payload fallback
- remaining calculation
Acceptance criteria
- Zed spend appears in CodexBar.
- Zed limit appears when available.
- Remaining is correct when spend + limit exist.
- No crash on incomplete data.
- Tests cover parser and value-calculation paths.
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 30, 2026, 7:28 AM ET / 11:28 UTC.
Summary Keep open for maintainer direction: the repository owner’s July 17, 2026 feasibility update says the existing Zed client endpoint already exposes the available plan and edit-prediction data, while token spend and invoices are only available through an undocumented billing portal. The requested feature therefore needs an upstream-supported Zed billing contract or an explicit decision to accept the maintenance and privacy risks of dashboard scraping.
Reproducibility: not applicable. this is a request for new Zed billing visibility, not a report of broken existing behavior. The owner’s feasibility review provides a high-confidence explanation of the missing upstream data contract.
Ways to help us reproduce this
- Add a screenshot or short recording showing the behavior.
- Include the exact command, prompt, or workflow that triggered it.
- Add expected vs actual behavior.
Maintainer decision needed
| Question | Recommendation |
|---|---|
| Should CodexBar remain limited to Zed’s supported client API until Zed publishes token-spend data, or should it intentionally support an undocumented dashboard-billing integration? | Wait for a supported Zed API: Keep the current provider boundary and revisit once Zed exposes spend and limits through a stable client contract. |
Why: The existing owner research establishes that the requested data is unavailable from the supported endpoint; choosing whether to scrape billing data is a product, privacy, and maintenance boundary that code review cannot safely infer.
Next step A maintainer must choose the permitted Zed billing-data boundary before any repair work; the current supported endpoint lacks the requested spend fields.
Review details
Best possible solution:
Wait for Zed to expose spend and limit data through a stable client API, then extend the existing Zed provider with typed optional billing fields, clear unavailable states, and focused parser/model tests.
Do we have a high-confidence way to reproduce the issue?
Not applicable: this is a request for new Zed billing visibility, not a report of broken existing behavior. The owner’s feasibility review provides a high-confidence explanation of the missing upstream data contract.
Is this the best way to solve the issue?
No: adding a dashboard scrape now is not the best supported solution because the relevant billing portal has no stable public contract. A stable Zed client API is the narrower, safer integration point.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
- Implementing this now would require scraping undocumented Zed dashboard billing endpoints, creating breakage risk when the portal changes and handling sensitive billing-session data outside the supported client API.
- A token-spend display without an authoritative Zed source could misstate spend, limits, or remaining balance and undermine the menu-bar status users rely on.
Codex review notes: model internal, reasoning high; reviewed against 8ef86077e70a.
Label changes
Label changes:
- remove
clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.
Label justifications:
P2: This is a useful provider-usage enhancement, but the evidence does not show an urgent regression or a blocked core workflow.impact:auth-provider: The request depends on what account and billing information the Zed provider can obtain and render.
Evidence reviewed
What I checked:
- Owner feasibility decision: The repository owner stated on July 17, 2026 that the existing Zed probe already decodes the data exposed by Zed’s client endpoint; token spend and invoices are only in the embedded Orb billing portal without a stable public contract.
- Requested behavior exceeds the confirmed endpoint: The issue asks for spend, limit, remaining, and billing period, but the owner’s investigation says the supported endpoint exposes plan information and edit-prediction counts rather than billing spend or invoice data.
- Repository review policy: The supplied full AGENTS.md directs provider data to remain siloed and favors parser/provider tests over live account probes; an undocumented dashboard integration would need a deliberate contract and non-interactive test seam. (
AGENTS.md:1, 8ef86077e70a) - Current issue discussion: The owner explicitly identifies an upstream request to zed-industries for a client-API spend surface as the effective path and says the feature can be revisited once that surface exists.
Likely related people:
- steipete: The repository owner authored the feasibility research establishing the current Zed API boundary and the condition for revisiting this request. (role: product and integration decision owner; confidence: high)
How this review workflow works
- ClawSweeper keeps one durable marker-backed review comment per issue or PR.
- Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
- A fresh review can be triggered by eligible
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch. - PR/issue authors and users with repository write access can comment
@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only. - Maintainers can also comment
@clawsweeper reviewto request a fresh review only. - Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
- Maintainer-only repair and merge flows require explicit commands such as
@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review. - Maintainers can comment
@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.
Feasibility research update: blocked upstream for now.
We verified against Zed's own client source that GET cloud.zed.dev/client/users/me carries only plan info and edit-prediction counts (crates/cloud_api_types/plan.rs); CodexBar's existing Zed probe already decodes everything that endpoint offers. Token spend and invoices live only in the dashboard.zed.dev embedded Orb billing portal, which has no stable public contract. Building this today would mean scraping undocumented dashboard endpoints, which was deliberately cut from the original Zed provider.
If you want this, the effective path is upstream: ask zed-industries to expose spend in the client API. We'll revisit as soon as such a surface exists.
Closing until Zed exposes a documented usage/quota API. Reopen with the endpoint contract and this becomes a standard provider request.