fix: handle nested Ollama Cloud usage response and hide per-model request counts - #243
Open
christian-taillon wants to merge 2 commits into
Open
Conversation
christian-taillon
force-pushed
the
fix/ollama-cloud-model-parsing
branch
from
August 27, 2026 16:31
d9283a3 to
6a1b907
Compare
christian-taillon
force-pushed
the
fix/ollama-cloud-model-parsing
branch
from
August 31, 2026 23:29
34da8fc to
a761584
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.