fix: handle nested Ollama Cloud usage response and hide per-model request counts - #243
Conversation
d9283a3 to
6a1b907
Compare
34da8fc to
a761584
Compare
|
@slkiser Ping for visibility when you have a chance to review this one. Small change her. Clean up the way Ollama Cloud was handled as a provider. This fixes Ollama Cloud against the current The PR updates parsing for the live nested response, removes those misleading request-count rows, and keeps the actual Session/Weekly quota reporting intact. It’s been validated against the live API, with typecheck/build passing and the full test suite green. Would appreciate a review since this affects the currently released Ollama Cloud integration. |
|
@christian-taillon Thanks! Been busy, had some comments for your other PR btw! |
Summary
The Ollama Cloud
/api/usageresponse changed shape, and the quota output showed rows that do not belong in a quota display. This PR fixes both parsing and presentation for the Ollama Cloud provider.1. Handle the nested usage response
The parser previously expected an optional top-level
payload.modelsarray. The current response instead nests per-model data inside each quota window (limits.session.modelsandlimits.weekly.models). Because the top-levelmodelsfield is absent, the parser emitted:even though the Session and Weekly quota values were valid.
limits.session.usageandlimits.weekly.usage.payload.modelsis now valid and produces no warning.payload.modelsremains supported when present.2. Hide per-model request counts
The provider also emitted one row per model, for example:
Per-model request counts are usage accounting, not quota windows. They make the toast, sidebar, and command output noisy and are not comparable to the percentage-based quota rows from other providers.
This PR removes per-model request rows from all surfaces (command, toast, sidebar, compact status) and removes the associated types, metadata, diagnostics, and tests. Only the Session and Weekly quota windows are reported:
The usage API still receives and safely ignores any per-model data in the response, including the nested
limits.*.modelsshape.Note on reset times
Ollama Cloud does not provide reset timestamps in
/api/usage(activity.periodis a rolling 4-week activity report ending at request time, not a quota reset). Reset countdowns therefore remain unavailable for this provider until Ollama exposes that data, consistent with the existingBlocked: not in provider APIlabel on the Ollama Cloud request in #38. This PR deliberately does not estimate reset times or reintroduce the unsupported settings-page cookie flow documented inproviders.md.Linked Issue
No existing issue found for the request-row removal. Scope: match the current Ollama Cloud
/api/usageresponse shape and keep quota output limited to actual quota windows. Refs #38 for the original Ollama Cloud provider request.OpenCode Validation
@opencode-ai/pluginpinned version)pnpm run typecheck: passedpnpm run build: passedgit diff --check: passedQuality Checklist
pnpm run typecheckpnpm run buildpnpm testAccountingMetadatais preserved.Superseded head note: the branch was rebased to correct the commit author identity; content is unchanged.