hive-agent: add debug logging around todo upsert/clear/mark-done

diagnostic instrumentation for #2678 (phantom 'you have todos' wakes
after clearing bash-task todos). logs subsystem/key/id/changed on
UpsertTodo, subsystem/key/all/count on ClearTodo, id/count on
MarkTodoDone, and a marker when the serve loop actually consumes a
todo_wake notification. no behavior change - RUST_LOG=debug only.
This commit is contained in:
damocles 2026-07-25 17:40:11 +02:00
commit 2dcbb78b40
2 changed files with 66 additions and 44 deletions

View file

@ -585,7 +585,10 @@ async fn serve_loop<S: Surface>(
}
} {
RecvOutcome::Message(first) => first,
RecvOutcome::LocalTodo => synthetic_todo_message(),
RecvOutcome::LocalTodo => {
tracing::debug!("todo wake consumed, sending synthetic todo message");
synthetic_todo_message()
}
RecvOutcome::Empty => {
// Idle: no message this poll. Service a queued operator
// `/compact` here so it runs even when no turn is driving