diff options
Diffstat (limited to 'crates/dinggerd/src/watcher.rs')
| -rw-r--r-- | crates/dinggerd/src/watcher.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/dinggerd/src/watcher.rs b/crates/dinggerd/src/watcher.rs index 91fa332..346bfa8 100644 --- a/crates/dinggerd/src/watcher.rs +++ b/crates/dinggerd/src/watcher.rs @@ -235,6 +235,7 @@ impl Watcher { } fn tick(&mut self) -> Result<(), String> { + let listed = std::time::Instant::now(); let panes = tmux::list_panes()?; let now = unix_now(); @@ -244,7 +245,7 @@ impl Watcher { hooks::forget(&panes.iter().map(|pane| pane.pane_id.clone()).collect::<Vec<_>>()); for pane in &panes { - let Some(observations) = observe(pane) else { + let Some(observations) = observe(pane, listed) else { debug!(target = %pane.display_target, "observation skipped (viewer screen)"); continue; }; @@ -393,13 +394,13 @@ impl Watcher { /// The pane's raw agent states this tick, in order, or `None` when the /// screen is a viewer (transcript, picker) that says nothing about state. -fn observe(pane: &tmux::Pane) -> Option<Vec<AgentState>> { +fn observe(pane: &tmux::Pane, listed: std::time::Instant) -> Option<Vec<AgentState>> { if pane.dead { return Some(vec![AgentState::Idle]); } let Some(agent) = pane.agent else { // The agent is gone; its last hook report must not outlive it. - hooks::drop_reports(&pane.pane_id); + hooks::drop_reports(&pane.pane_id, listed); return Some(vec![AgentState::Unknown]); }; // Agent-reported state is authoritative; it survives restarts through |
