Restore async legacy notify hook

This commit is contained in:
Ahmed Ibrahim
2026-03-04 21:55:12 -08:00
parent 7d7b67192f
commit df4c918bd2
+3 -8
View File
@@ -62,19 +62,14 @@ pub fn notify_hook(argv: Vec<String>) -> Hook {
command.arg(notify_payload);
}
// Preserve the legacy argv + JSON payload shape, but wait for completion so
// after-agent hooks finish their side effects before the turn is marked done.
// Backwards-compat: match legacy notify behavior (argv + JSON arg, fire-and-forget).
command
.stdin(Stdio::null())
.stdout(Stdio::null())
.stderr(Stdio::null());
match command.status().await {
Ok(status) if status.success() => HookResult::Success,
Ok(status) => HookResult::FailedContinue(
std::io::Error::other(format!("legacy notify exited with status {status}"))
.into(),
),
match command.spawn() {
Ok(_) => HookResult::Success,
Err(err) => HookResult::FailedContinue(err.into()),
}
})