Location
crates/librefang-kernel/src/kernel/mod.rs:5458, 5497, 6292, 10970, 11985, 11620, 11644, 11703, 11942 and ~20 more sites
Problem
Many tokio::spawn(async move { ... }) invocations either drop the JoinHandle or hold but never await it. Tokio's default behavior: panics propagate only to the JoinHandle — without an awaiter, panics vanish, no log. supervisor.record_panic exists but is only called in the explicit Err(e) branch — it doesn't catch real Rust panics (unwrap on None, slice out of bounds, serialization failures, etc.).
Impact
A tool invocation panics on a corner-case input; that agent's loop dies silently, no alert. A channel-bridge spawn panics; that bridge stops working until daemon restart; no diagnostics.
Fix
Wrap with AssertUnwindSafe(...).catch_unwind() and on Err call supervisor.record_panic(name, info). Centralize via a kernel.spawn_supervised(name, fut) helper used everywhere.
Filed via automated multi-perspective audit (security / concurrency / architecture / error-handling / frontend / performance subagents). Curated against #3359–#3409 to avoid duplicates.
Location
crates/librefang-kernel/src/kernel/mod.rs:5458, 5497, 6292, 10970, 11985, 11620, 11644, 11703, 11942and ~20 more sitesProblem
Many
tokio::spawn(async move { ... })invocations either drop the JoinHandle or hold but neverawaitit. Tokio's default behavior: panics propagate only to the JoinHandle — without an awaiter, panics vanish, no log.supervisor.record_panicexists but is only called in the explicitErr(e)branch — it doesn't catch real Rust panics (unwrap on None, slice out of bounds, serialization failures, etc.).Impact
A tool invocation panics on a corner-case input; that agent's loop dies silently, no alert. A channel-bridge spawn panics; that bridge stops working until daemon restart; no diagnostics.
Fix
Wrap with
AssertUnwindSafe(...).catch_unwind()and on Err callsupervisor.record_panic(name, info). Centralize via akernel.spawn_supervised(name, fut)helper used everywhere.Filed via automated multi-perspective audit (security / concurrency / architecture / error-handling / frontend / performance subagents). Curated against #3359–#3409 to avoid duplicates.