diff --git a/hive-ag3nt/src/forge_notify.rs b/hive-ag3nt/src/forge_notify.rs index b99026a1..b56b4c7d 100644 --- a/hive-ag3nt/src/forge_notify.rs +++ b/hive-ag3nt/src/forge_notify.rs @@ -847,6 +847,15 @@ async fn poll_once( match deliver_result { Ok(()) => { debug!(%id, "forge_notify: delivered"); + // Record the delivered version in the dedupe cursor INSTEAD + // of marking the thread read. Leaving it unread is + // deliberate: the hive-forge read-before-comment guard keys + // off forge's own unread-state, and the agent reading the + // thread via the CLI is what marks it read. Recorded only + // here in the Ok arm — a failed delivery hits the Err arm + // and `continue`s without recording, so it re-delivers next + // tick. + delivered.insert(id, updated_at); } Err(e) => { warn!(%id, error = ?e, "forge_notify: deliver failed — leaving unread"); @@ -854,14 +863,6 @@ async fn poll_once( } } - // Record the delivered version in the dedupe cursor INSTEAD of - // marking the thread read. Leaving it unread is deliberate: the - // hive-forge read-before-comment guard keys off forge's own - // unread-state, and the agent reading the thread via the CLI is - // what marks it read. A failed delivery (above) is left - // unrecorded so it re-delivers next tick. - delivered.insert(id, updated_at); - // Auto-unsubscribe from broad repo watches after delivering a // `subscribed` notification. Gated by HIVE_FORGE_KEEP_SUBSCRIPTIONS // for triage / firehose agents (see