pub(crate) fn save_final_state(state: &AppState, block_id: &str)Expand description
Clear session:active_pid (so the next boot doesn’t read this as an
interrupted session) and mark the local instance row stopped. The session
id itself is left everywhere it is — block meta, instance row, shared
registry — so reopening the agent resumes it (spec §4.2 step 6).