Repository navigation
Add Kimchi to the agents panel - #14166
oleksandrsan wants to merge 3 commits into
Conversation
Kimchi's plan, prepaid credits, and spend budgets come from the gateway endpoints its own status line reads; tokens come from its pi session files. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Each endpoint now caches and falls back on its own, keyed by gateway and key; a spend cap no longer poses as purchased credit; a rejected key no longer offers the panel's sign-in, which can't sign in to Kimchi; and capped providers show in budget periods of any length. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An endpoint that fails with nothing cached now marks the record stale and asks for a sooner retry, server errors included. Each endpoint caches to its own file and only replaces an answer fetched before it, so overlapping refreshes can't roll the cache back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
| # it actually got. | ||
| def billing_cache(key, base, resource): | ||
| digest = hashlib.sha256((base + "\n" + key).encode()).hexdigest()[:16] | ||
| return cache_root() / f"kimchi-{resource}-{digest}.json" |
There was a problem hiding this comment.
Existing billing cache is ignored
After an upgrade, if the gateway is unavailable before the first successful refresh, the collector looks only for the new per-endpoint cache files. It does not read the previous kimchi-billing-<digest>.json file, so the panel cannot show the last known credits and budgets during that outage.
There was a problem hiding this comment.
There was a problem hiding this comment.
You’re right — since kimchi-billing-*.json was never present in a released Omarchy version and only existed in earlier commits within this PR, no upgrade migration is required. A first run correctly starts with the per-endpoint caches. This finding does not apply; no change is needed.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
|
Thanks, @oleksandrsan! The Kimchi panel support this PR proposes is shipped in current quattro: collector, manifest entry and assets landed via #14040 ( |
Adds Kimchi as an agent in the agents panel, following the same shape as the Grok collector.
What it shows
/v1/credits— the endpoint Kimchi's own status line reads — as the panel's balance gauge./v1/budgetas limit lines that reset when the period ends, titled Monthly/Weekly by the period's length, with each capped provider inside a budget drawn as a scoped tick on that line. A personal (USER/API_KEY) budget also supplies the balance's funded figure, since the credits answer doesn't say how much was bought.~/.config/kimchi/harness/sessions(honoringKIMCHI_CODING_AGENT_DIR), with cached input kept apart.Key and gateway resolve the way the CLI does:
KIMCHI_API_KEY, then~/.config/kimchi/config.json;KIMCHI_BASE_URL, then the configured region (us/eu). When the gateway can't be reached, the last answer stays up withlimitsStale/limitsFetchedAtandretryAdvisedset; the cache is keyed per API key.On a real account, the local session totals matched Kimchi's server-side analytics to within one 117-token background call out of ~1.9M, so the collector doesn't call the analytics API.
Files
bin/omarchy-agent-usage-kimchi— the collectortest/shell.d/agent-usage-kimchi-test.sh— 11 checks against a faked gatewayshell/plugins/agents/assets/kimchi.svg— the chili mark from Kimchi's logo (orange, works on light and dark surfaces, so no-lighttwin)shell/plugins/agents/manifest.json,README.md,manual/17-ai.md— registration and docsTesting
test/shell.d/agent-usage-*-test.sh: all pass, including the new one../test/shell: the 11 files that fail on this machine fail identically on a cleanquattrocheckout (they need anomarchy-pkgscheckout,omasnap, etc.).omarchy-kernel-migration-test.shhangs when stdin is left open — its fakepacmanreads$2as the package, butomarchy-pkg-presentnow callspacman -Q -- <pkg>(since b72d7e5), so grep waits on stdin. Not touched here.🤖 Generated with Claude Code