Expand description
agents logs read subscribe — first-ping-or-go-inactive
wait loop.
Outer loop:
- Existence check (side-effect-free) per target, filtered by
the optional kinds. If ANY target has a matching unread row
past its watermark, call
read_pending_for_parentfor ALL targets (UNFILTERED — kinds gate “wake up”, not the returned slice) and emit every block. Close. - Else: lock check. If no target’s instance lock
(
crate::command::agents::locks) is held, emitAgentsInactiveand close. - Else: per held-target, race
wait_for_logs_message_atvslockfile::wait_released. First fire wins. DB ping → restart from step 1 (but loop back to existence check — type-filter false positives are dropped silently). Lock release → restart from step 1.