pub(crate) fn persist_last_failure(
block_id: &str,
failure: Option<&AgentFailure>,
wstore: &Option<Arc<Store>>,
event_bus: &Option<Arc<EventBus>>,
)Expand description
Persist or clear the last agent failure in block metadata.
Pass Some(failure) on a failed exit to write agent:last_failure into the
block’s meta so the pane can recover the recovery banner on any future load
without needing the ephemeral WPS event. Pass None on a clean exit to
remove the key (setting it to JSON null triggers merge_meta’s delete path).
Broadcasts a waveobj:update so active frontend subscribers see the change
immediately via the block atom, not just on next full load.