Skip to content

Add a Hermes usage collector to the agents panel - #6899

Closed
Salt-555 wants to merge 1 commit into
omacom:quattrofrom
Salt-555:add-hermes-agent
Closed

Salt-555 wants to merge 1 commit into
omacom:quattrofrom
Salt-555:add-hermes-agent

Conversation

@Salt-555

Copy link
Copy Markdown

Summary

Adds a omarchy-agent-usage-hermes collector so the agents panel shows Hermes Agent usage alongside Claude, Codex, and Fireworks.

What it does

  • New collector bin/omarchy-agent-usage-hermes: sums the Hermes session store (~/.hermes/state.db, honored via HERMES_HOME) into the shared record contract, matching how Hermes itself counts — root sessions with at least one message that are not archived, attributed to the day each session started. Reasoning tokens count as output; each API call is one prompt.
  • No limits endpoint: Hermes runs on bring-your-own providers (Nous Portal, OpenRouter, OpenAI, Anthropic, ...), so there is no account to probe. The record carries an empty limits list and local stats only.
  • No panel changes: the panel discovers the record by convention, resolves the caduceus mark from assets/hermes.svg, and draws the tab.
  • Docs: manifest description, collector table, and a "Hermes" section in the plugin README.
  • Test: agent-usage-hermes-scanner-test.sh pins the record shape (reasoning folded into output, cache split, provider-prefix stripping, prompt counting), the child/archived/empty session exclusions, day attribution, the local-stats cache, and --force/--limits-only behavior.

Validation

test/shell.d/agent-usage-hermes-scanner-test.sh passes (12 assertions), as do the existing agent-usage-update-test.sh, agents-panel-test.sh, and agents-default-migration-test.sh.

Copilot AI balanced review requested due to automatic review settings August 14, 2026 21:09

Copilot AI 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.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds Hermes as a supported provider in the agents bar widget by introducing a Hermes usage collector (local-only) plus supporting UI/assets and tests.

Changes:

  • Added omarchy-agent-usage-hermes collector to scan Hermes state.db, aggregate tokens/prompts/sessions, and cache results.
  • Enabled Hermes by default in the agents plugin manifest and documented Hermes behavior/configuration.
  • Added a shell-based integration test and a Hermes icon asset.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/shell.d/agent-usage-hermes-scanner-test.sh Adds end-to-end shell test covering Hermes session aggregation and cache behavior.
shell/plugins/agents/manifest.json Enables Hermes provider by default and updates plugin description.
shell/plugins/agents/assets/hermes.svg Adds Hermes icon asset for the UI.
shell/plugins/agents/README.md Documents Hermes provider semantics and configuration.
bin/omarchy-agent-usage-hermes Implements Hermes local usage collector with caching/locking.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

touched in the last 30 days, and Fireworks requests the last 30 days from its
billing API, so their totals and day counts cover that window. Claude's cover
every transcript still on disk.
every transcript still on disk, and Hermes' every session row in its store.
Comment on lines +75 to +80
[[ $(jq -c '.modelUsage["hermes-4-405b"]' <<<"$result") == '{"inputTokens":100,"outputTokens":28,"cacheReadInputTokens":30,"cacheCreationInputTokens":5}' ]] ||
fail "Hermes collector folds reasoning into output and keeps cache separate" "$result"
pass "Hermes collector folds reasoning into output and keeps cache separate"

# Provider prefixes are stripped from model ids, like the Hermes dashboard.
[[ $(jq -c '.modelUsage["hermes-3-70b"]' <<<"$result") == '{"inputTokens":300,"outputTokens":62,"cacheReadInputTokens":0,"cacheCreationInputTokens":0}' ]] ||
Comment on lines +75 to +80
[[ $(jq -c '.modelUsage["hermes-4-405b"]' <<<"$result") == '{"inputTokens":100,"outputTokens":28,"cacheReadInputTokens":30,"cacheCreationInputTokens":5}' ]] ||
fail "Hermes collector folds reasoning into output and keeps cache separate" "$result"
pass "Hermes collector folds reasoning into output and keeps cache separate"

# Provider prefixes are stripped from model ids, like the Hermes dashboard.
[[ $(jq -c '.modelUsage["hermes-3-70b"]' <<<"$result") == '{"inputTokens":300,"outputTokens":62,"cacheReadInputTokens":0,"cacheCreationInputTokens":0}' ]] ||

[[ $(jq -r '.activeDays' <<<"$result") == "2" ]] ||
fail "Hermes collector counts distinct active days" "$result"
[[ $(jq -r '.activeDates[0]' <<<"$result") == "$(date -d yesterday +%Y-%m-%d)" ]] ||
cache_file=$(ls "$cache_home/.cache/omarchy/agent-usage/"/hermes-scan-*.json 2>/dev/null | head -n 1)
[[ -n $cache_file && -s $cache_file ]] ||
fail "Hermes collector leaves a cache file behind" "$result"
[[ $(stat -c %a "$cache_file") == "644" ]] ||
The omarchy-agent-usage-hermes collector sums the Hermes session store
(~/.hermes/state.db, honored via HERMES_HOME) into the shared record
contract, the same way Hermes itself counts: root sessions with at least one
message that are not archived, attributed to the day each session started.
Reasoning tokens count as output and each API call is one prompt, so the panel
shows the same token and pace story as the other agents. Hermes runs on
whatever providers you sign in to, so there is no account to probe for limits
— the record carries an empty limits list and local stats only.

The panel needs nothing new: it discovers the record by convention, resolves
the caduceus mark from assets/hermes.svg, and draws the tab. The manifest and
README list Hermes alongside the other collectors, and a scanner test pins
the record shape, cache, and --force/--limits-only behavior.
Copilot AI review requested due to automatic review settings August 14, 2026 21:12

Copilot AI 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.

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated no new comments.

@Salt-555

Copy link
Copy Markdown
Author

Closing this in favor of #6645 by @okurmustafa, which already covers local Hermes usage attribution (and more — per-model and auxiliary-task attribution) with its own collector and scanner test. No value in two PRs for the same surface. Thanks for the great work on this.

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.

2 participants