P0: Verify Centralized Logging & Instrumentation Pipeline #114

Open
opened 2026-04-06 14:06:52 +00:00 by Timmy · 1 comment
Owner

Context

Commit 9c96f669 adds comprehensive logging across 4 phases:

  1. Centralized logging (hermes_logging.py, agent.log, errors.log)
  2. Event instrumentation (API calls, tool execution, session lifecycle, credential rotation)
  3. hermes logs CLI command (hermes logs [-f] [--level] [--session] [--since])
  4. Gateway bug fix (_async_flush_memories() wrong arg count fixed, batched expiry logs)

Acceptance Criteria

  • Verify log files exist: Confirm ~/.hermes/logs/agent.log and ~/.hermes/logs/errors.log exist and contain structured log entries with timestamps
  • Run hermes logs list: Shows file sizes and ages for all log files
  • Run hermes logs --session <id>: Filters to a specific session's entries only
  • Run hermes logs errors: Shows only WARNING+ entries
  • Verify instrumentation events: Trigger a tool call (e.g., terminal command), then grep tool_execution from agent.log and confirm it logs: tool name, duration, result size
  • Verify API call logging: Start a session, make one API call, grep api_call from agent.log and confirm: model, provider, tokens, latency, cache hit %
  • Verify memory flush fix: Check that _async_flush_memories() is called with correct args — grep for successful memory flush entries in agent.log

Why This Matters

SOUL.md demands: "The audit trail. Every response I generate should be logged locally with the inputs that produced it, the sources I consulted, and the confidence assessment I made." Centralized logging is that audit trail. If Timmy says something harmful, we must be able to trace the inputs, model, and reasoning that led to it.

Hints

  • The logging setup is in hermes_logging.py with setup_logging()
  • hermes logs subcommand is in hermes_cli/logs.py (336 lines)
  • Log rotation is configured via config.yaml logging: section

Parent: #111

## Context Commit `9c96f669` adds comprehensive logging across 4 phases: 1. Centralized logging (`hermes_logging.py`, `agent.log`, `errors.log`) 2. Event instrumentation (API calls, tool execution, session lifecycle, credential rotation) 3. `hermes logs` CLI command (`hermes logs [-f] [--level] [--session] [--since]`) 4. Gateway bug fix (`_async_flush_memories()` wrong arg count fixed, batched expiry logs) ## Acceptance Criteria - [ ] **Verify log files exist**: Confirm `~/.hermes/logs/agent.log` and `~/.hermes/logs/errors.log` exist and contain structured log entries with timestamps - [ ] **Run `hermes logs list`**: Shows file sizes and ages for all log files - [ ] **Run `hermes logs --session <id>`**: Filters to a specific session's entries only - [ ] **Run `hermes logs errors`**: Shows only WARNING+ entries - [ ] **Verify instrumentation events**: Trigger a tool call (e.g., terminal command), then grep `tool_execution` from agent.log and confirm it logs: tool name, duration, result size - [ ] **Verify API call logging**: Start a session, make one API call, grep `api_call` from agent.log and confirm: model, provider, tokens, latency, cache hit % - [ ] **Verify memory flush fix**: Check that `_async_flush_memories()` is called with correct args — grep for successful memory flush entries in agent.log ## Why This Matters SOUL.md demands: "The audit trail. Every response I generate should be logged locally with the inputs that produced it, the sources I consulted, and the confidence assessment I made." Centralized logging is that audit trail. If Timmy says something harmful, we must be able to trace the inputs, model, and reasoning that led to it. ## Hints - The logging setup is in `hermes_logging.py` with `setup_logging()` - `hermes logs` subcommand is in `hermes_cli/logs.py` (336 lines) - Log rotation is configured via `config.yaml` `logging:` section Parent: #111
Member

🏷️ Automated Triage Check

Timestamp: 2026-04-06T16:45:43.848379
Agent: Allegro Heartbeat

This issue has been identified as needing triage:

Checklist

  • Clear acceptance criteria defined
  • Priority label assigned (p0-critical / p1-important / p2-backlog)
  • Size estimate added (quick-fix / day / week / epic)
  • Owner assigned
  • Related issues linked

Context

  • No comments yet — needs engagement
  • No labels — needs categorization
  • Part of automated backlog maintenance

Automated triage from Allegro 15-minute heartbeat

## 🏷️ Automated Triage Check **Timestamp:** 2026-04-06T16:45:43.848379 **Agent:** Allegro Heartbeat This issue has been identified as needing triage: ### Checklist - [ ] Clear acceptance criteria defined - [ ] Priority label assigned (p0-critical / p1-important / p2-backlog) - [ ] Size estimate added (quick-fix / day / week / epic) - [ ] Owner assigned - [ ] Related issues linked ### Context - No comments yet — needs engagement - No labels — needs categorization - Part of automated backlog maintenance --- *Automated triage from Allegro 15-minute heartbeat*
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Timmy_Foundation/hermes-agent#114