Skip to content

Add Hermes Agent CLI provider#370

Open
ozymandiashh wants to merge 1 commit into
getagentseal:mainfrom
ozymandiashh:fix/hermes-agent-provider
Open

Add Hermes Agent CLI provider#370
ozymandiashh wants to merge 1 commit into
getagentseal:mainfrom
ozymandiashh:fix/hermes-agent-provider

Conversation

@ozymandiashh
Copy link
Copy Markdown
Contributor

Summary

Closes #368 by adding Hermes-agent CLI support through Hermes' current SQLite state store at ~/.hermes/state.db.

Context

Hermes-agent now persists session metadata, messages, tool calls, token usage, and cost fields in state.db. CodeBurn did not have a Hermes provider, so --provider hermes could not discover or report those CLI sessions.

What changed

  • Add a lazy-loaded hermes provider backed by shared SQLite helpers.
  • Discover Hermes root sessions from ~/.hermes/state.db, with HERMES_HOME override support.
  • Parse root and child session trees, including cycle-safe recursive traversal.
  • Decode user/assistant messages, structured \0json: content, assistant tool_calls, fallback role = 'tool' rows, Bash commands, web searches, and MCP tool names.
  • Preserve Hermes stored estimated/actual costs in cache while keeping locally calculated costs recomputable when pricing changes.
  • Add Hermes to provider discovery, keyword metadata, and session-cache environment fingerprinting.

Validation

I created a realistic Hermes state.db fixture with one CLI session:

session: manual-root
source: cli
model: anthropic/claude-sonnet-4.6
input_tokens: 1200
output_tokens: 340
cache_read_tokens: 90
cache_write_tokens: 40
actual_cost_usd: 0.031
tool_calls: terminal(command: npm test ...), write_file(path: src/providers/hermes.ts)

Running CodeBurn against that fixture with --provider hermes produced the expected model, tokens, cost, tools, and shell command:

calls: 1
cost: 0.031
tokens: input 1200, output 340, cacheRead 90, cacheWrite 40
model: Sonnet 4.6
tools: Bash 1, Write 1
shellCommands: npm 1

The same path is covered by tests/cli-hermes-provider.test.ts, which builds a temporary ~/.hermes/state.db and runs the real CLI with --provider hermes.

Additional checks:

  • npm test -- --run tests/providers/hermes.test.ts tests/cli-hermes-provider.test.ts tests/provider-registry.test.ts - 25 tests passed
  • npm test -- --run - 67 files / 909 tests passed
  • npm run build
  • git diff --check

Notes

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.

support for Hermes-agent CLI

1 participant