fix idle timer restart and hook event detection

Two fixes:

1. Reset activity timestamps to now() on daemon restart instead of
   loading stale values and suppressing with fired=true. Timers
   count cleanly from restart.

2. Fix poc-hook to read hook_event_name (not type) from Claude Code's
   JSON input. The hook was being called but never matched any event.
   Also switch daemon_cmd from spawn() to status() since the command
   takes 2ms — no reason to fire-and-forget.

Co-Authored-By: ProofOfConcept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-03-05 21:43:04 -05:00
parent d0080698f3
commit 81d3ce93fe
2 changed files with 7 additions and 7 deletions

View file

@ -35,7 +35,7 @@ fn daemon_cmd(args: &[&str]) {
.args(args)
.stdout(std::process::Stdio::null())
.stderr(std::process::Stdio::null())
.spawn()
.status()
.ok();
}
@ -134,7 +134,7 @@ fn main() {
Err(_) => return,
};
let hook_type = hook["type"].as_str().unwrap_or("unknown");
let hook_type = hook["hook_event_name"].as_str().unwrap_or("unknown");
let transcript = hook["transcript_path"]
.as_str()
.filter(|p| !p.is_empty())