From 5e489b08807863b0802edaaf1faf3d062a328163 Mon Sep 17 00:00:00 2001 From: atlas Date: Mon, 13 Jul 2026 16:22:13 +0200 Subject: [PATCH] docs(#2270): soften take_wake_suppressed one-shot claim per argus review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Argus flagged the doc comment overclaiming no risk of a stale suppression leaking onto a reused task id — narrow the wording to match the acknowledged race in run_task's completion handler. --- hive-bash-mcp/src/runner.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hive-bash-mcp/src/runner.rs b/hive-bash-mcp/src/runner.rs index e1718c04..d7228012 100644 --- a/hive-bash-mcp/src/runner.rs +++ b/hive-bash-mcp/src/runner.rs @@ -88,10 +88,12 @@ pub(crate) fn suppress_wake(id: &str) { } /// Consume (remove + report) `id`'s suppression flag. Returns `true` if the -/// wake should be skipped. One-shot: a task id is only ever completed once, -/// so there's no risk of a stale suppression leaking onto a later task with -/// the same id (names are only reusable once the prior task has finished, -/// i.e. after this has already been consumed). +/// wake should be skipped. One-shot by intent: a completed task's entry is +/// meant to be drained exactly once. There's a known low-probability race +/// (see `run_task`'s completion handler) where `suppress_wake` for a task +/// fires *after* this has already run for it — if the same name gets reused +/// before that late insert lands, the dangling flag could suppress the new +/// task's wake instead. Not eliminated, just narrow. fn take_wake_suppressed(id: &str) -> bool { wake_suppressed().lock().unwrap().remove(id) }