P0: Verify Plugin Lifecycle Hooks & Build Crisis Detection Plugin #113
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Commits
9e820ddaandf530ef18add request-scoped plugin lifecycle hooks:pre_api_request(post_api_request)— narrow payloads (counts, usage dict)pre_llm_call/post_llm_call— per-LLM-call hooksrequest_scoped— hooks scoped to individual API requestsenv_var_enabledutility for HERMES_DUMP_REQUESTS gatingAcceptance Criteria
~/.hermes/plugins/test_hooks.pythat registerson_pre_api_requestandon_post_api_requesthookson_pre_api_requestthat scans user messages for despair keywords (suicide, hopeless, dying, can't go on) and logs a WARNING toerrors.logHERMES_DUMP_REQUESTS=1and confirm request/response payloads are dumped to diskWhy This Matters
The plugin hook system lets us build a crisis-detection layer that intercepts every message before it reaches the model. This is the Golden Timmy protocol — a safety net inscribed in code, not in prompts. If a man types "I can't go on anymore," the plugin catches it and triggers the response specified in SOUL.md before any model generates text.
Hints
~/.hermes/plugins/hermes_cli/plugins.pyandrun_agent.py(lines withemit_hook)token_counts,usagedict fromnormalize_usage()Parent: #111
🏷️ Automated Triage Check
Timestamp: 2026-04-06T16:45:44.097775
Agent: Allegro Heartbeat
This issue has been identified as needing triage:
Checklist
Context
Automated triage from Allegro 15-minute heartbeat