The same model billed through a different door is its own row on every surface. The route rides on the call as a field: the model id names it when the door renames the model (Bedrock's <vendor>.<model>[-vN:M], with the cross-region profile kept as its own SKU), and the provider's own column names it when it does not (Hermes billing_provider). Only bedrock is registered; openrouter and bedrock-mantle wait for real sessions. Every report keys a model row on one function, modelRowKey: short name plus the door's label. models-report folds on that row key rather than the route id, so two doors sharing one label can never print two rows a reader cannot tell apart. codeburn models --format json carries route per row. Daily cache moves to v33: day.models is keyed by the row key so a column-sourced route survives into a finalized day, and hermes joins the pending-rederive table. Hermes sessions re-parse once. Pricing never consults the route and runs on the raw id. granular-history still keys on the raw model id, so the desktop Trend timeline is the one surface outside this. Verified on a real cache: 142 finalized days, $37,898.851498 and 272,985 calls unchanged.
3.4 KiB
Hermes Agent
Hermes Agent CLI profiles.
- Source:
src/providers/hermes.ts - Loading: eager (
src/providers/index.ts) - Test:
tests/providers/hermes.test.ts
Where it reads from
| Source | Path |
|---|---|
| Default Hermes profile | $HERMES_HOME/state.db if set, otherwise ~/.hermes/state.db |
| Named Hermes profiles | $HERMES_HOME/profiles/<profile>/state.db |
Storage format
SQLite. The provider reads Hermes' aggregate sessions token/cost counters and the matching messages rows for user prompt and tool-call context.
Parser
Hermes stores durable token accounting at the session level, so CodeBurn emits one parsed call per Hermes session instead of one call per LLM API request. The call contains the aggregate session totals:
- input tokens
- output tokens
- cache-read tokens
- cache-write tokens
- reasoning tokens
- actual or estimated cost when Hermes recorded one
If Hermes recorded no positive cost, CodeBurn falls back to its normal model pricing table.
Billing route
Hermes records the door a session was billed through separately from the model: sessions.billing_provider is anthropic, openai-codex, bedrock, … The parser maps it through routeFromProviderField to the call's route (bedrock; every other value, direct doors included, maps to none), so a session on --provider bedrock lands in a Fable 5.1 (Bedrock) row next to — never merged with — the direct row. For a Bedrock session the model column already carries Bedrock's id, so the id shape and the column agree. The route rides on the cached call; the billing-route-v1 parse version forces one re-parse of sessions cached before it existed.
Project grouping
Discovery groups sessions by Hermes profile (default, coder, analytics, etc.). When a session message includes a clean Current working directory: /path line, parsing can attach that project path so CodeBurn can canonicalize worktrees. The parser deliberately ignores quoted or escaped prompt text that merely contains the phrase Current working directory:.
Tool mapping
Hermes tool_calls are normalized to CodeBurn display names where possible:
terminal->Bashread_file->Readwrite_file->Writepatch->Editsearch_files->Grep- browser tools ->
Browser - web tools ->
WebSearch/WebFetch - skill tools ->
Skill
Terminal command arguments are exposed as bashCommands for CodeBurn's command breakdowns.
Caching
The shared session cache fingerprints Hermes state DB files. HERMES_HOME is included in the provider environment fingerprint so changing the runtime home invalidates stale cached results.
Quirks
- The provider is aggregate-first because Hermes' stable accounting lives in
sessions. Do not infer per-turn usage from message text. - Source paths are encoded as
<dbPath>#hermes-session=<sessionId>so SQLite paths containing:remain safe. - SQLite schema checks are intentionally light: if the expected
sessionsormessagescolumns are absent, the DB is skipped.
When fixing a bug here
- Reproduce against a real Hermes
state.dbor a minimal SQLite fixture. - Run
npx vitest run tests/providers/hermes.test.ts. - For local smoke testing, use an isolated cache directory, for example:
CODEBURN_CACHE_DIR=/tmp/codeburn-hermes-cache node --import tsx -e "import { parseAllSessions } from './src/parser.ts'; console.log(await parseAllSessions(undefined, 'hermes'))".