Repository navigation
Conversation
Ship omarchy-agent-usage-ollama, which reads the account's 5-hour session and 7-day weekly limits from Ollama's usage endpoint and local token stats from pi and omp sessions on the ollama-cloud provider. The panel gains an Ollama Cloud tab with no plugin changes, matching the existing claude, codex, and fireworks collectors.
Contributor
|
Thank you! Brought in with your authorship in #14039. The computed reset times were dropped, since the endpoint doesn't return them and the window alignment couldn't be confirmed, and kept limits are marked stale after a failed check. |
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.
What
Adds an
ollamacollector to the agents panel, alongsideclaude,codex, andfireworks. The panel gains an Ollama Cloud tab with no plugin changes — the collector prints the same display-ready record contract the other collectors do.GET https://ollama.com/api/usage(Bearer API key) reports the account's 5-hour session and 7-day weekly usage as 0..1 fractions. The endpoint does not return reset times, and the resets are the same for every account, so the collector computes them: epoch-aligned 5-hour session windows, weekly windows ending Monday 00:00 UTC.POST https://ollama.com/api/mesupplies the tier label ("Pro").ollama-cloudprovider, with model version tags merged (deepseek-v4-pro:0813→deepseek-v4-pro).OLLAMA_API_KEYfirst, then the key pi/omp signed in with (~/.pi/agent/auth.json,~/.omp/agent/auth.json), then an optionalapiKeyin~/.config/omarchy/agents/ollama.json.modelPrefixin~/.config/omarchy/agents/ollama.jsonrestricts local stats to matching models (e.g."claude"for the Claude models Ollama Cloud serves). The account limits always cover the whole account.Also ships
ollama.svg/ollama-light.svgmarks for the bar icon and panel hero, addsollamato the manifest provider defaults, and documents the collector in the plugin README.Testing
test/shell.d/agent-usage-ollama-scanner-test.sh(12 tests): session scan across pi and omp roots, provider filtering, tag merging, model prefix, limits parsing, reset computation, cache reuse/fallback, transport retry advice, rejected-key reporting,--forcere-probe../test/clipasses (116/116)../test/shellshows only the pre-existing baseline failures (verified identical on a clean checkout).