- Version: v0.3.0 package metadata; v0.3.1 working branch behavior
- Repository:
/home/zycas/hermes-continuation - Branch:
main - Sync state:
mainsynced toorigin/main - Last commit: Task D + CI update + docs
- Test status: full suite should pass on Windows after the current compatibility fixes
| Module | Purpose |
|---|---|
auto_doctor.py |
Gateway-side restart/handoff advisory using message count, elapsed time, tool calls, and optional task completeness |
dialogue_context.py |
Read dialogue context from state.db by source_platform + source_chat_id |
doctor.py plugin mode |
Skip git/task state when called from gateway; inject plugin_mode signal |
plugin.py |
Register on_turn_complete hook and return the advisory payload to compatible wrappers |
gateway/run.py |
Invoke on_turn_complete hook after agent response |
| Command | Function | Writes files? |
|---|---|---|
hermes-handoff create |
Write handoff packet (Markdown + JSON) | ✅ |
hermes-handoff resume |
Read existing handoff JSON | ❌ |
hermes-handoff doctor |
Analyze if handoff is recommended | ❌ |
hermes-handoff prepare |
Preview handoff content | ❌ |
hermes-handoff watch |
One-shot scan: tool calls, elapsed, changed files | ❌ |
| Module | Purpose |
|---|---|
context_monitor.py |
Auto-collect git changed_files + accept injected session metrics |
auto_watch.py |
Gateway notification gating: thresholds + cooldown + config |
watch_logger.py |
Local JSONL event logger (zero token cost) |
| External cron/scheduler | Can call hermes-handoff watch or plugin watch surfaces; no packaged daemon is started by default |
| Tool | Function |
|---|---|
hermes_handoff_create |
Write handoff packet |
hermes_handoff_resume |
Read existing handoff |
hermes_handoff_prepare |
Preview handoff content |
hermes_handoff_watch |
One-shot watch evaluation |
hermes_handoff_doctor |
Analyze + recommend |
Trigger sources Processing layer Notification targets
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Gateway │ ──┬───→ │ │ │ Feishu │
│ Wrapper │ │ │ Watch │ ──────→ │ 報告群 │
└──────────┘ │ │ Engine │ └──────────┘
│ │ │
┌──────────┐ │ │ (reuses │ ┌──────────┐
│ Cron │ ──┤ │ v0.2.0 │ │ Gateway │
│ Jobs │ │ │ doctor │ ──────→ │ Session │
└──────────┘ │ │ prepare │ └──────────┘
│ │ watch) │
┌──────────┐ │ └──────────┘
│ Context │ ──┘ ┌──────────┐
│ Monitor │ │ Logger │ → Local JSONL
└──────────┘ └──────────┘
⚠️ 有一個開發中的專案建議交接
已開發約 45 分鐘,使用 80+ 次工具,12 個檔案有變更
→ 回對話中輸入 /handoff prepare 來預覽交接內容
Design principles:
- ❌ No repo name or path (prevents info leak in groups)
- ❌ No changed file names
- ✅ Approximate counts only (45 min, 80+ calls, 12 files)
- ✅ Actionable next step (
/handoff prepare) - ✅ Mobile-readable in one glance
plugin._on_turn_complete() now returns a structured payload instead of discarding the evaluation result. Below threshold it remains silent (None). Above threshold, wrappers can inspect:
restart_recommendedhandoff_recommendedmetrics.message_countmetrics.tool_call_countmetrics.elapsed_minutestask_execution.completion_percentsignals/reasonshandoff_prompt
The hook is still read-only: it does not start a new conversation and does not write .hermes/handoffs/.
Logs to ~/.hermes/logs/handoff_watch.jsonl:
{"ts":"2026-05-15T14:30:00+00:00","level":"advise","tool_calls":8,"elapsed":45,"changed_files":3,"trigger":"gateway","recommendation_level":"prepare"}Key properties:
- Zero LLM-token cost (not read by agent)
- No conversation content, file contents, or repo paths
- String fields capped at 200 characters
- Best-effort (never raises, never blocks)
plugins:
config:
hermes-continuation:
auto_watch:
enabled: true
tool_calls_threshold: 5
elapsed_minutes_threshold: 30
cooldown_minutes: 20
notify_levels: ["advise", "prepare", "block"]
watch_repos:
- /home/zycas/hermes-continuation
- /home/zycas/.hermes/hermes-agent- Python 3.11 / 3.12 / 3.13 on GitHub Actions
- pytest suite (124 tests)
- compileall for all Python files
- v0.3.0 module import verification
- Lightweight secret scan (excludes
handoff_watch_logsdir) - Whitespace + conflict marker check
watch_logger.py+ 15 unit tests- Integrated into
evaluate_and_log()onauto_watch.py auto_watch.pytests updated with 5 newevaluate_and_logtests
handoff_watch_review.pyimplemented + 24 unit/integration tests- Reads watch log JSONL, prints analysis with level distribution, trigger sources, cooldown ratio, average metrics, and threshold tuning suggestions
- Requires ≥50 log entries before meaningful tuning
--days Nfilter for time-bounded analysis- Target: false positive rate <30%, zero noise complaints
| Priority | Item | Depends on |
|---|---|---|
| P0 | Two-week dogfood + threshold tuning | Real usage data |
| P1 | Output readability tuning for non-technical users | Dogfood feedback |
| P2 | Daemon background monitor (v0.4+) | Design boundaries defined in TRIGGER_POLICY.md |