Skip to content

feat: add Hermes Agent session collector#139

Open
goelahradhikami-cmyk wants to merge 4 commits into
graykode:mainfrom
goelahradhikami-cmyk:main
Open

feat: add Hermes Agent session collector#139
goelahradhikami-cmyk wants to merge 4 commits into
graykode:mainfrom
goelahradhikami-cmyk:main

Conversation

@goelahradhikami-cmyk

Copy link
Copy Markdown

Summary

Adds a new collector for Hermes Agent — an open-source AI agent framework by Nous Research. Hermes belongs to the same category as Claude Code, Codex CLI, and OpenCode.

How it works

  1. Process discovery: Scans running processes for python -m tui_gateway.slash_worker --session-key <id> to map PIDs → Hermes session IDs
  2. Session data: Reads Hermes' SQLite state.db (~/.hermes/state.db or ~/AppData/Local/hermes/state.db on Windows desktop) for session metadata, token counts, model info
  3. PID→session matching: Connects the two by matching session IDs
  4. Status inference: Uses process CPU + recent activity to determine Thinking/Executing/Waiting/Done
  5. Context window: Built-in model→context_size lookup table for 20+ models (configurable)

Supported features

Feature Status
Session Discovery
Token Tracking (input/output/cache)
Status Detection
Context Window % ✅ (model lookup table)
Child Processes
Git Status ✅ (via existing MultiCollector git sweep)
Rate Limit ❌ (Hermes doesn't expose this)

Usage

Hermes sessions appear automatically with agent_cli "hermes". To hide them:

hidden_agents = ["hermes"]

Cross-platform

Tested on Windows. Works on Linux and macOS via the same sqlite3 CLI approach used by OpenCodeCollector.

Closes #...

Adds a new collector module for Hermes Agent (github.com/NousResearch/hermes-agent)
that monitors Hermes sessions alongside Claude Code, Codex CLI, and OpenCode.

Hermes collector discovers Hermes workers via process command-line scanning
(--session-key flag), reads the SQLite state.db for session metadata and
token counts, and maps running PIDs to DB sessions by session ID.

Supported features:
- Session discovery (running Hermes workers)
- Token tracking (input, output, cache read/write)
- Context window % via model lookup table (20+ models)
- Status detection (Thinking/Executing/Waiting/Done)
- Child process tracking
- Cross-platform Windows/Linux/macOS support
- Configurable via hidden_agents = ["hermes"] in config.toml

The Hermes agent_cli identifier is "hermes" so users can hide
Hermes sessions with:
  hidden_agents = ["hermes"]
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