Skip to content

feat(ollama): track Ollama cloud subscription usage (status bar + Accounts) - #37829

Open
jamesjfoong wants to merge 14 commits into
stablyai:mainfrom
jamesjfoong:feat/ollama-cloud-usage
Open

jamesjfoong wants to merge 14 commits into
stablyai:mainfrom
jamesjfoong:feat/ollama-cloud-usage

Conversation

@jamesjfoong

@jamesjfoong jamesjfoong commented Nov 3, 2026 •

Copy link
Copy Markdown

ELI5

Orca shows usage meters for many AI subscriptions, but not for Ollama's cloud plans. This change adds Ollama as a tenth usage provider: save the API key from ollama.com once and Orca shows your remaining included credits and your 30-day cloud spend in the status bar, refreshed with the same cycle as every other provider.

What Changed

  • src/main/rate-limits/ollama-usage-fetcher.ts — new fetcher against the documented cloud endpoints (GET https://ollama.com/api/balance, GET https://ollama.com/api/usage?range=30d, Authorization: Bearer <OLLAMA_API_KEY>, 15s timeout, documented 10 req/min rate limit respected by the shared poll cadence). Both documented balance shapes parse via zod at the boundary: modern plans spend down a USD allowance (balance_usd/allowance_usd), legacy plans expose session/weekly remaining_percent. The 30d usage response (request count, USD spend, token counts) is carried as a named ollamaUsageTotals field instead of being forced into a quota window — no invented percents.
  • src/main/ollama/ollama-cloud-api-key-store.ts + ollama-cloud-credential-commands.ts — async sealed API-key storage mirroring the GLM Coding Plan path: OS-encrypted envelope when available, owner-only plaintext fallback on POSIX, and fail-closed saves on Windows if encryption is unavailable; explicit save/clear/status with sealed-elsewhere refusal.
  • Wiring: ollama joins ProviderRateLimits['provider'], RateLimitState, service state/generation/backoff maps, sibling fetch cycle (prepared alongside zcode, applied with the same generation guard), accounts.ollamaCloud* RPC methods, preload bridge window.api.ollamaCloudCredentials, status-bar letter L, and settings-target mapping to accounts-ollama.
  • src/renderer/src/components/settings/OllamaCloudAccountsSection.tsx — Settings ▸ Accounts section: key entry (password input, Save/Replace/Forget), subscription usage block with included credits and 30-day spend across requests.
  • 36 en.json catalog entries; zh untranslated falls back to English per repo policy.

Why

Ollama's ollama launch integrations (claude, codex, droid, …) already work inside Orca terminals, so cloud subscribers hit usage limits Orca cannot see. Reusing the existing rate-limit provider architecture (zod parse once at the boundary, sibling promise cycles, sealed key files) gives Ollama the same treatment as Codex credits or GLM Coding Plan with no new polling code paths.

Linked Issue

Fixes #21476 (Ollama Cloud portion; OpenRouter and TokenRouter remain open in that issue)

Visual Proof

These screenshots compare the same synthetic Ollama Cloud usage state on the original PR head and after the feedback fix. They do not show live account data.

Before

Ollama Cloud usage on the original PR head

After

Ollama Cloud usage after the feedback fix

Both screenshots were captured in hidden Electron runs with synthetic usage data; they do not show a live Ollama account. I manually tested the Ollama usage flow locally. The screenshots are visual evidence of the before/after UI state, while the manual test was performed separately.

Testing

  • I manually tested the Ollama usage flow locally. Cross-platform UI verification was not performed.
  • Automated tests added/updated. The fetcher tests cover an omitted optional spend total. The orchestration tests cover Codex queued during Grok, modern Ollama usage after transient failure, and a repeated Ollama refresh queued during a full refresh.
  • The added tests cover the reported failures and avoid the repository test anti-patterns.

Validation:

  • pnpm check:changed -- --maxWorkers=4 --timeout=45: all 40 checks passed on the rebased branch against base 6b1e12d2 (17m 45s).
  • Focused Vitest run: 5 files, 35/35 tests passed.
  • git diff --check passed.
  • Full pnpm lint, pnpm test, and pnpm build were not run as separate commands; the changed-file gate does not replace the full suite or build.

Notes

  • Usage endpoints are cloud-only (https://ollama.com); local servers (http://localhost:11434) expose no usage API, so the provider reports unavailable: missing-credentials semantics instead of pretending.
  • Keys are sent only to ollama.com; no token analytics are computed locally.
  • Credential storage uses OS encryption when available. If it is unavailable, POSIX stores plaintext with owner-only file and directory permissions; Windows saves fail closed instead of writing plaintext. Cross-platform UI verification was not performed.

Risk

Level: Medium. Recent Ollama balance and totals stay visible through transient failures for the normal stale window. Full refreshes reuse the provider-cycle drain, so repeated queued refreshes run before waiters resolve. Generation checks still discard results from an invalidated key. Reverting the follow-up restores the prior behavior.

AI Disclosure

OpenAI Codex assisted with review-feedback analysis, code changes, and validation.

Review

Earlier review feedback and follow-up findings are addressed in the current branch. All existing review threads are resolved.

Agent skill upstream boundary

  • Not applicable. This change does not copy or translate upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • This PR remains focused on Ollama usage feedback.
  • The ELI5, user-facing change, and reason are explained above.
  • The risk and rollback path are stated above.
  • Before/after screenshots are included above. The captures use synthetic data; manual Ollama usage-flow verification was performed separately by the author.
  • Self-reviewed the changed files for correctness, security, and performance.
  • Considered cross-platform and SSH/remote behavior. Credential storage fails closed on Windows if safeStorage encryption is unavailable; UI verification across platforms was not performed.
  • Full pnpm lint, pnpm typecheck, pnpm test, and pnpm build commands pass or are covered by CI. The changed-file gate passed; full lint, full test, and build remain unverified separately.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 14:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@jamesjfoong

Copy link
Copy Markdown
Author

Scope note: this covers the Ollama Cloud portion of #21476 (status-bar usage bar + Settings ▸ Accounts section). OpenRouter and TokenRouter remain open there — same architecture applies if this lands. Visual proof (before/after screenshots) coming in a follow-up once I capture the running app.

@jamesjfoong

Copy link
Copy Markdown
Author

Pushed 1c4c90cb: review pass closing two data-completeness gaps — purchased balance_usd is now kept distinct from the included allowance end-to-end (parser → ollamaUsageTotals.purchasedBalanceUsd → Accounts row) and the documented input/cached/output token counters render as a 30-day token row. Fetcher tests 7/7; pnpm lint (41/41), tc:node, tc:web clean. Visual proof screenshots still pending — attaching when I can run the app.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

This change adds Ollama Cloud API-key storage and credential operations through local IPC and environment RPC. It adds balance and usage parsing and fetching to the rate-limit cycle, with Ollama state included in refresh and configuration reporting. The Accounts interface supports credential management and displays available subscription usage. Ollama is also added to status-bar provider mapping and settings navigation.

Merge Risk: Moderate · up to b2338

The Ollama status-bar entry currently shows no balance or usage, displays as "ollama" with the wrong icon, and does not show a loading state. A forced Codex or Claude refresh can stall behind an Ollama refresh. Fix these, and the misleading labels and error visibility in Accounts and Stats, before merging.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning The PR changes unrelated queue behavior in src/main/rate-limits/service/service-fetch-queue.ts. fetchGrokOnly now uses runSingleProviderDrain, which no longer drains queued `codexOnlyFetchQueued… Restore the Codex-only and Claude-only queue drains in fetchGrokOnly with their original force settings. Keep the shared drain limited to behavior that preserves those requests, or retain the original Grok loop and use the helper only for…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: tracking Ollama Cloud subscription usage in the status bar and Accounts settings.
Linked Issues check Passed Issue #21476 is open and directly linked. This PR implements the Ollama Cloud slice only, which is the stated first implementation slice. It adds user-pasted API-key storage, Accounts UI, rate-limit f…
Description check Passed The description follows the repository template and covers the main sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Risk, AI Disclosure, and Checklist. It explains the new Olla…
Full details: Linked Issues check

Explanation

Issue #21476 is open and directly linked. This PR implements the Ollama Cloud slice only, which is the stated first implementation slice. It adds user-pasted API-key storage, Accounts UI, rate-limit fetch and refresh wiring, the L status-bar item, visibility settings, missing-credential unavailable state, configured exhausted-balance display, and focused fetcher tests. It supports legacy session and weekly percentages and modern currency allowances without inventing money-based percentage windows. The 30-day usage totals preserve request and token counts. OpenRouter and TokenRouter remain outside this slice.

Full details: Description check

Explanation

The description follows the repository template and covers the main sections: ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, Risk, AI Disclosure, and Checklist. It explains the new Ollama Cloud usage provider, its fetcher, sealed API-key storage, wiring, and settings UI. It links issue #21476 and says the PR covers only the Ollama Cloud portion. Visual proof is attached as before and after screenshots, with a note that they use synthetic data. Testing lists the focused Vitest run, the changed-file gate, and the checks that were not run. Risk gives a level, the riskiest areas, and a rollback note. Remaining gaps: the Risk section's rollback guidance is thin, since it says only that reverting the follow-up restores prior behavior and does not describe the full revert path. The Review section is brief. The Testing checkbox for anti-pattern avoidance is ticked without evidence beyond the author's statement. The 'Full lint/test/build' checklist item is unchecked, which is accurate but leaves verification incomplete. The 'Visual Proof' section does not clearly show a tabbed or switchable before and after comparison.

Full details: Out of Scope Changes check

Explanation

The PR changes unrelated queue behavior in src/main/rate-limits/service/service-fetch-queue.ts. fetchGrokOnly now uses runSingleProviderDrain, which no longer drains queued codexOnlyFetchQueued and claudeOnlyFetchQueued requests. This changes existing Codex and Claude scheduling and is not required for issue #21476. The incremental diff from the previous reviewed head is empty for this file, so this issue remains unresolved.

Resolution

Restore the Codex-only and Claude-only queue drains in fetchGrokOnly with their original force settings. Keep the shared drain limited to behavior that preserves those requests, or retain the original Grok loop and use the helper only for Ollama. Add a queue test that verifies a Codex-only or Claude-only request queued during a Grok-only cycle still runs.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up Comments

Outside diff Re-check fullFetchQueued after the provider-only sub-cycles in fetchAll.

72-79: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Re-check fullFetchQueued after the provider-only sub-cycles in fetchAll.

A forced refresh that arrives during the codex, claude, or grok sub-cycle in fetchAll can be left queued. fetchAll checks fullFetchQueued only before those sub-cycles (service-fetch-queue.ts:27). The loop then exits, resolveFetchIdleWaiters() returns early while the flag is set, and the queued full cycle runs only at a later unforced fetchAll.

Ollama save and clear now reach this path. invalidateOllamaCredentialState() sets Ollama to a fetching status, then the helper calls refresh(), which calls fetchAll({ force: true }). Ollama is not refreshed by the provider-only cycles, so it can stay in fetching status until the next background poll. With the default 15-minute poll interval, that can be up to 15 minutes. Without background polling, it stays until another full cycle starts.

Suggested fix
           if (grokSignal.aborted) {
             break
           }
         }
+        if (this.fullFetchQueued) {
+          this.fullFetchQueued = false
+          shouldContinue = true
+        }
       }

Open the source location

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7718640d-4be1-49f7-8c5a-2c14746a0161
Commits

Reviewing files that changed from the base of the PR and between 1c4c90c and e7b41cb.

Files selected for processing: 17
  • src/main/ipc/rate-limits.ts
  • src/main/ollama/ollama-usage-cycle-preparation.ts
  • src/main/rate-limits/service/service-account-refresh.ts
  • src/main/rate-limits/service/service-fetch-queue.ts
  • src/main/rate-limits/service/service-provider-cycles.ts
  • src/main/rate-limits/service/service-state.ts
  • src/preload/api/agent-usage-api.ts
  • src/preload/api/rate-limits-bridge.ts
  • src/renderer/src/components/settings/AccountsPane.tsx
  • src/renderer/src/components/settings/OllamaCloudAccountsSection.tsx
  • src/renderer/src/components/settings/accounts-search.ts
  • src/renderer/src/components/settings/ollama-cloud-accounts-search.ts
  • src/renderer/src/components/stats/OllamaUsagePane.tsx
  • src/renderer/src/components/stats/StatsPane.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/store/slices/rate-limits.ts
  • src/renderer/src/web/preload-api/web-rate-limits-api.ts
Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (4)

Minor · Drain queued Ollama refreshes before resolving idle waiters. · service-fetch-control.ts:4-35

src/main/rate-limits/service/service-fetch-control.ts:4-35
Minor · Functional Correctness · Quick win

Drain queued Ollama refreshes before resolving idle waiters.

When refreshOllama() runs during fetchGrokOnly(), the Grok finally block can resolve the refresh promise while ollamaOnlyFetchQueued remains set. The IPC caller then receives stale usage, and the pane stops showing its refresh state before the Ollama fetch runs.

Include the Ollama flag in both idle predicates, then start the queued Ollama drain from the Grok-only completion path. Adding only the flag checks would leave this waiter pending because the Grok drain does not otherwise consume the Ollama queue.

Suggested fix
--- a/src/main/rate-limits/service/service-fetch-control.ts
+++ b/src/main/rate-limits/service/service-fetch-control.ts
@@
       !this.codexOnlyFetchQueued &&
       !this.claudeOnlyFetchQueued &&
-      !this.grokOnlyFetchQueued
+      !this.grokOnlyFetchQueued &&
+      !this.ollamaOnlyFetchQueued
@@
       this.codexOnlyFetchQueued ||
       this.claudeOnlyFetchQueued ||
-      this.grokOnlyFetchQueued
+      this.grokOnlyFetchQueued ||
+      this.ollamaOnlyFetchQueued
--- a/src/main/rate-limits/service/service-fetch-queue.ts
+++ b/src/main/rate-limits/service/service-fetch-queue.ts
@@
     } finally {
       this.isFetching = false
+      if (this.ollamaOnlyFetchQueued) {
+        this.ollamaOnlyFetchQueued = false
+        await this.ollamaOnlyFetch()
+      }
       this.resolveFetchIdleWaiters()
     }
   }
Minor · Discard Ollama-only results after credential invalidation. · service-provider-cycles.ts:185-217

src/main/rate-limits/service/service-provider-cycles.ts:185-217
Minor · Functional Correctness · Quick win

Discard Ollama-only results after credential invalidation.

When a save or clear advances ollamaFetchGeneration, an active runFetchOllamaOnlyCycle can still apply usage fetched with the old key. This briefly restores stale usage after the credential state was cleared, until the queued refresh replaces it. Capture the generation before the fetch and ignore the result when it changes.

Suggested fix
     const previousState = this.state
+    const ollamaGeneration = this.ollamaFetchGeneration
 
     this.updateState({
       ...previousState,
@@
-    if (signal.aborted) {
+    if (signal.aborted || ollamaGeneration !== this.ollamaFetchGeneration) {
       return
     }
Minor · Make usage_usd nullable so one omitted field does not discard… · ollama-usage-fetcher.ts:23-29

src/main/rate-limits/ollama-usage-fetcher.ts:23-29
Minor · Data Integrity & Integration · Quick win

Make usage_usd nullable so one omitted field does not discard all usage totals.

The documented UsageMetrics schema lists only request_count as required. usage_usd is optional there. This schema requires usage_usd. A valid usage response without that field fails the parse. parseOllamaUsageResponse then returns every usage total as null, including requestCount and the token counters. fetchOllamaCloudRateLimits still returns status: 'ok', and the UI shows — for each value.

Suggested fix
   totals: z.object({
     request_count: z.number(),
-    usage_usd: z.number(),
+    usage_usd: z.number().nullish(),
     input_tokens: z.number().nullish(),
-    spentUsd: parsed.data.totals.usage_usd,
+    spentUsd: parsed.data.totals.usage_usd ?? null,
Minor · Do not map legacy purchased credits to extraUsage.balance. · ollama-usage-fetcher.ts:98-125

src/main/rate-limits/ollama-usage-fetcher.ts:98-125
Minor · Functional Correctness · Quick win

Do not map legacy purchased credits to extraUsage.balance.

extraUsage.balance is consumed as included credits by Stats and Accounts and as a generic balance by the status bar. The legacy branch currently assigns purchased.balance_usd to that field. Keep the value in purchasedBalanceUsd and set the legacy extraUsage.balance to null. The existing consumers already handle that value: Stats and Accounts retain the separate purchased-credit display, while the status bar and tooltip suppress the extra balance output.

Suggested fix
     extraUsage: {
       unit: 'currency',
-      balance: purchased.balance_usd,
+      balance: null,
       currencyCode: 'USD',
Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25f57a13-9af8-4f18-96eb-8f450ca9fda5
Commits

Reviewing files that changed from the base of the PR and between e7b41cb and 7e4e18b.

Files selected for processing: 2
  • src/renderer/src/components/stats/OllamaUsagePane.tsx
  • src/renderer/src/i18n/locales/en.json
Files skipped from review as they are similar to previous changes: 1
  • src/renderer/src/i18n/locales/en.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

Minor · Include Ollama in anyFetching. · use-status-bar-controller.ts:224

src/renderer/src/components/status-bar/use-status-bar-controller.ts:224
Minor · Functional Correctness · Quick win

Include Ollama in anyFetching.

The aggregate still omits ollama. When the Ollama refresh is fetching, this hook returns false, so consumers of anyFetching do not show the loading state. Add the Ollama status check. (raw.githubusercontent.com)

Proposed fix
-    zcode?.status === 'fetching'
+    zcode?.status === 'fetching' ||
+    ollama?.status === 'fetching'
Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b26af57d-03b5-4ff6-9fec-fb89cca58de4
Commits

Reviewing files that changed from the base of the PR and between 7e4e18b and b23384d.

Files selected for processing: 5
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.test.ts
  • src/renderer/src/components/status-bar/status-bar-provider-visibility.ts
  • src/renderer/src/components/status-bar/use-status-bar-controller.ts
  • src/shared/status-bar-defaults.ts
  • src/shared/ui-chrome-types.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@jamesjfoong
jamesjfoong force-pushed the feat/ollama-cloud-usage branch 2 times, most recently from 266f8f7 to 277be70 Compare November 6, 2026 04:26
@jamesjfoong

Copy link
Copy Markdown
Author

The outside-diff findings are also addressed in commit 3ddb622: fetchAll rechecks queued full refreshes after provider-only cycles; the provider drain handles queued Ollama, Codex, Claude, Grok, and full refreshes before resolving waiters; Ollama-only results are discarded after credential invalidation; usage_usd is optional; and legacy purchased balance stays separate from extraUsage.balance.

Ollama's cloud usage API (ollama.com/api/balance and /api/usage?range=30d,
Bearer OLLAMA_API_KEY, 10 req/min) becomes a tenth rate-limit provider:

- ollama-usage-fetcher.ts parses both balance shapes (modern USD allowance,
  legacy session/weekly percents) via zod at the boundary; 30d totals ride a
  named ollamaUsageTotals field instead of a fake quota window
- sealed API-key store + credential commands mirror the GLM Coding Plan path;
  explicit save/clear/status over IPC and RPC (accounts.ollamaCloud*)
- fetch cycles prepare the sibling promise alongside zcode and apply with a
  generation guard; failures track the shared backoff streaks
- OllamaCloudAccountsSection in Settings > Accounts: key entry with sealed
  storage, included credits, and 30-day spend labels; status bar letter L
Review pass over fetcher contract: the modern balance branch dropped
purchased.balance_usd and the 30d totals dropped input/cached/output token
counts. Both now survive into the shared ollamaUsageTotals field; the
Accounts section renders purchased credits and token rows beside the
included allowance.
StatsPane gains an Ollama tab backed by the same cloud snapshot as the
status bar (no fake per-worktree attribution): included/purchased credits,
30-day spend, tokens, plus an empty state that opens Accounts. Refresh
rides a dedicated rateLimits:refreshOllama IPC -> refreshOllama() ->
ollamaOnlyFetch queue drain, deduped with Grok's loop into
runSingleProviderDrain. Key-read failures settle as Ollama-only
unavailable (non-retryable) so an undecryptable envelope cannot spend
every activation window on a doomed refetch.
Legacy plans answer session/weekly remaining percents; the pane dropped
them, showing only USD cards. Render both rows whenever the balance
response carries windows.
The compact/detailed Usage popup filtered providers at
use-status-bar-controller; ollama was missing from the roster, the
visibility settings contract and the empty-state check, so the panel in
the screenshot never listed it. Wire it like zcode: key-presence flag
(ollamaApiKeyConfigured), default status-bar item, roster/empty-state
coverage, plus an ollama unavailable-row expectation in the visibility
suite. Restore the zcode pending clause the first edit clobbered.
ProviderIcon's unmatched-provider fallback rendered Claude's mark for
Ollama. Add OllamaIcon (theme-foreground llama silhouette) and route the
provider, the Stats Usage tab icon, and the windowless roster row to it.
Fetch the 64px icon from ollama.com/public/icon-64x64.png into
src/shared/agent-icons/ollama.png and render it from OllamaIcon
(offline-bundled like the other agent favicons, stablyai#8451), replacing the
guessed silhouette SVG. Import depth fixed to match
agent-favicon-assets (../../../../shared/...).
…I schema

StatusBarItem parity caught the drift: the shared PersistedUIState and
defaults gained 'ollama' while the z.enum in UiUpdateFieldsSchema had
not, so AssertNoMissingValues rejected every desktop payload.
Upstream moved AccountsPane into accounts/, helpers into
accounts/usage/, section primitives into section-layout/, and split
visibility tests; re-point Ollama section imports, pane wiring, and the
lifetime-test imports accordingly. Provide the ollama display name in
usage-provider-windows (satisfies exhaustiveness).
@jamesjfoong
jamesjfoong force-pushed the feat/ollama-cloud-usage branch from e013b46 to 98bbefe Compare November 19, 2026 21:58

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: OpenRouter, TokenRouter, and Ollama Cloud usage tracking (status bar + Accounts)

2 participants