Skip to content

Support for Hermes Agent? #913

Closed
Closed

Description

@APZmedia

Is it in the roadmap?

Activity

  1. ozymandiashh commented on Aug 4, 2026

    @ozymandiashh
    Collaborator

    Good news: Hermes Agent is already supported, and has been since v0.9.14 (June 2026), so it is not on the roadmap, it already shipped.

    CodeBurn reads Hermes' local SQLite state directly:

    • default profile: ~/.hermes/state.db (or $HERMES_HOME/state.db if set)
    • named profiles: ~/.hermes/profiles/<name>/state.db

    Hermes keeps durable token accounting at the session level, so CodeBurn reports one entry per Hermes session with input/output/cache/reasoning tokens. It uses the cost Hermes recorded when there is one, and falls back to CodeBurn's own pricing table otherwise. Tool calls (terminal, read_file, patch, ...) are normalized into CodeBurn's tool breakdowns too. Details: docs/providers/hermes.md

    Any recent version works (current is v0.9.19). If you have Hermes installed and nothing shows up in codeburn report, run codeburn doctor and paste the output here and we will take a look.

    Closing as already supported. Feel free to comment if anything does not behave as expected.

  2. APZmedia commented on Aug 4, 2026

    @APZmedia
    Author

    Thank you! I'm seeing some issues though

    Missing sessions (17 in DB vs 14 reported) Three sessions from today are not being counted. The hermes provider queries sessions WHERE input_tokens + output_tokens + cache_read_tokens + cache_write_tokens + reasoning_tokens > 0, so these sessions should match — but they're being dropped somewhere in the parser or dashboard aggregation.

    Cost calculation is wrong by 3-4x
    Even if all 17 sessions were counted, the LiteLLM-priced cost should be ~$5.52 for the token volumes observed. CodeBurn reports $1.65.

    Possible causes:
    Model name resolution failure: Sessions store the name of the model. The getCanonicalName() strips the prefix to get the model, which does exist in LiteLLM. But the pricing lookup may be failing silently (returning 0) or resolving to a different/cheaper model.

    Cache read tokens may not be priced: 28M cache read tokens = $1.22 of the expected cost. If these are being dropped or priced at $0, the remaining would still be higher suggesting the issue compounds.

    The dist build may not include the hermes provider: The hermes provider lives at /.codeburn/src/providers/hermes.ts but is not present in the upstream codeburn-source repo. If the dist build (/.codeburn/dist/cli.js) doesn't include it, --provider hermes may silently fall back to the opencode provider which looks for DBs at ~/.local/share/opencode/ (which doesn't exist on this system).

    OpenRouter markup not accounted for
    The model name routes through OpenRouter, which adds a markup.

    Environment
    CodeBurn version: installed at ~/.codeburn/ (with custom hermes provider at ~/.codeburn/src/providers/hermes.ts)
    Hermes state.db: ~/.hermes/state.db (565 MB, 663 sessions)

  3. ozymandiashh commented on Aug 4, 2026

    @ozymandiashh
    Collaborator

    Thanks for the detailed follow-up. I dug into both reports against the actual code paths. One of your symptoms is a real bug, now fixed in #915. The cost gap needs one piece of data from you to pin down. Reopening until both are resolved.

    Missing sessions: real bug, fixed in #915

    Your three missing sessions are almost certainly explained by SQLite WAL mode, and the arithmetic matches exactly.

    Hermes keeps state.db open in WAL mode for the life of the agent, so recent commits park in state.db-wal and the main file's mtime only moves on checkpoint. CodeBurn fingerprinted only the main file, and the date-range pre-filter in the parser skips any source whose mtime predates the range start. The today-parse starts at local midnight, so whenever the last checkpoint happened before midnight, every session started today is skipped. Sessions started yesterday or earlier still arrive through the historical backfill, which is why you see exactly "all of them except the ones from today": 17 in the DB, 14 reported.

    #915 folds the -wal sibling into the fingerprint (newest mtime wins, sizes add), which fixes both the skip and a related staleness where a session that grew between checkpoints kept reporting old totals. You can confirm this is what you are hitting with:

    ls -la ~/.hermes/state.db*
    

    If state.db has an mtime older than your local midnight while state.db-wal is fresh, that is the bug.

    Your other hypotheses, checked against the code

    • "The hermes provider is not in the upstream repo / dist may silently fall back to opencode." The provider has shipped upstream since v0.9.14 (src/providers/hermes.ts, docs in docs/providers/hermes.md). The discovery query you quoted, WHERE input + output + cache_read + cache_write + reasoning > 0, is that upstream file, so whatever you inspected was reading our source. Also, --provider with an unknown name errors out loudly listing the valid providers (src/main.ts), it never falls back to another provider. Your description of ~/.codeburn/src/ plus a prebuilt dist/cli.js sounds like a source checkout; to remove that variable entirely, please run the released build (npx codeburn@latest report) and tell us codeburn --version.
    • "Cache read tokens may not be priced." They are priced whenever the model resolves and the pricing row carries cache_read_input_token_cost (see calculateCost in src/models.ts). But note the point below, which usually matters more.
    • "Model name resolution failure, silent $0." Possible, and diagnosable: run with CODEBURN_VERBOSE=1 and any model that fails pricing lookup prints a no pricing data for model "..." warning. Please paste those if they appear. Small note: your comment shows the model name as blank ("The model name routes through OpenRouter"), so please include the exact model string as stored in the sessions table.
    • "OpenRouter markup not accounted for." Here is the key precedence, and my earlier comment stated it too: when Hermes recorded a cost for a session (actual_cost_usd, else estimated_cost_usd), CodeBurn reports that number verbatim and never consults its own pricing table. The LiteLLM fallback only prices sessions with no recorded cost. So if your sessions carry recorded costs, the $1.65 is Hermes's own accounting, and a 3-4x gap against a hand-computed LiteLLM figure means Hermes's recorded numbers are low (for example an estimator that ignores cache reads), not that CodeBurn mispriced tokens.

    What would settle the cost question

    Please paste the output of:

    sqlite3 ~/.hermes/state.db "SELECT id, model, billing_provider, coalesce(input_tokens,0), coalesce(output_tokens,0), coalesce(cache_read_tokens,0), coalesce(cache_write_tokens,0), coalesce(reasoning_tokens,0), estimated_cost_usd, actual_cost_usd FROM sessions WHERE coalesce(input_tokens,0)+coalesce(output_tokens,0)+coalesce(cache_read_tokens,0)+coalesce(cache_write_tokens,0)+coalesce(reasoning_tokens,0) > 0 ORDER BY started_at;"
    

    plus codeburn doctor and codeburn --version. Session ids and titles can be redacted, the columns that matter are model, the five token counts and the two cost columns. With that we can tell per session which cost source CodeBurn used and whether anything mispriced.

    One heads-up while we are at it: because Hermes accounts tokens at session level and its sessions can span days, long-running sessions have a separate known undercount pattern in the daily history (usage added to a session after its start day is finalized). #915 fixes today's visibility; the multi-day attribution is tracked separately in #916.

  4. iamtoruk commented on Aug 10, 2026

    @iamtoruk
    Member

    Hermes Agent support is shipped: the provider reads the SQLite state DBs under ~/.hermes (HERMES_HOME honored), is registered as a core provider, and has docs (docs/providers/hermes.md) plus a fixture test suite. It ships in npm 0.9.19 today; the known daily-history edge for session-cumulative reporting is tracked in #916.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions