Skip to content

fix(ollama): show monthly cloud usage limit - #1270

Open
robinebers wants to merge 1 commit into
mainfrom
codex/fix-ollama-monthly-usage
Open

robinebers wants to merge 1 commit into
mainfrom
codex/fix-ollama-monthly-usage

Conversation

@robinebers

@robinebers robinebers commented Sep 17, 2026

Copy link
Copy Markdown
Owner

TL;DR

Ollama accounts with a monthly cloud allowance now show a Monthly meter. A reported limits.monthly.usage = 0.053 becomes 5.3% usage in the API and 5% used in the dashboard's existing whole-percentage format.

Fixes #1268.

What was happening

  • The Ollama mapper read only Session and Weekly, silently discarding the Monthly allowance.
  • A Free-plan response containing only Monthly usage and recent activity produced the spend row without a quota meter.

What this changes

  • Read Monthly through the existing percentage helper and register its dashboard widget.
  • Enable Monthly as Always Visible, after Weekly, without adding a menu-bar pin. Existing layouts receive it once; later opt-outs remain respected.
  • Export monthly in /v1/limits and include its progress line in /v1/usage.
  • Preserve omission of absent or unusable values, treat zero as real usage data, and supply no guessed reset date.
  • Update the provider and API docs, and add regression coverage for mapping, widget data, API output, and layout upgrades.

Heads-up

Thanks to @maxmilian for identifying the missing Monthly mapping.

Tests

  • Full SwiftPM suite: 1,384 tests, 3 skipped, zero failures. The local Xcode beta needed the downloaded Sparkle framework supplied through DYLD_FRAMEWORK_PATH for test loading.
  • CONFIG=debug ./script/build_and_run.sh verify: rebuild, signing, restart, and process verification passed.
  • Native dashboard screenshots reviewed for monthly-only Free and combined Session/Weekly/Monthly payloads.
  • git diff --check passed.

Screenshots

Native captures of the dashboard header and metric rows using synthetic Free and Pro payloads, with the meter set to Used. The Free fixture supplies only Monthly; Session and Weekly correctly show No data.

Free Pro
Ollama Free with a Monthly usage meter Ollama Pro with Session, Weekly, and Monthly usage meters

Note

Low Risk
Scoped Ollama provider change with optional-field parsing unchanged; layout migration is tested and does not touch auth or shared infrastructure.

Overview
Ollama Cloud now surfaces Monthly plan usage when limits.monthly is present in /api/usage, fixing cases (e.g. Free) where only a monthly allowance was returned and no quota meter appeared.

The mapper adds a Monthly percent line via the same percentLine helper as Session/Weekly (fraction → %, no guessed resetsAt). A new ollama.monthly widget exports monthly to /v1/limits and /v1/usage. Default layout enables Monthly above the fold (after Weekly, not menu-bar pinned); upgrades add it once while respecting prior opt-outs. Docs and tests cover mapping edge cases, API projection, and layout migration.

Reviewed by Cursor Bugbot for commit 5c031eb. Bugbot is set up for automated code reviews on this repo. Configure here.

Map limits.monthly.usage, register the Monthly widget, and export the
monthly percentage through the local limits API. Enable Monthly above
the fold after Weekly without adding a menu-bar pin.

Add regression coverage for monthly-only Free plans, absent and unusable
values, dashboard data, both API shapes, and layout upgrades.

Thanks to @maxmilian for identifying the missing monthly mapping in
#1268 (comment).

Fixes #1268.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ollama monthly usage limit is not displayed

1 participant