Skip to main content

remove_controller_entry_only

Function remove_controller_entry_only 

Source
fn remove_controller_entry_only(block_id: &str)
Expand description

Remove a controller from CONTROLLER_REGISTRY only — does NOT touch the process tracker or the Process Broker’s cached status, unlike delete_controller below. For resync_controller’s replace path (session restart), where a NEW controller for the same block is about to be registered right after this call: AgentProcessRegistry:: ensure_tracker is idempotent by design (“the job survives controller re-creation” — its own doc comment), so leaving the tracker alone here means any declared-background descendant (e.g. task dev) the old controller’s process spawned stays alive and gets reattached to the new controller’s own track_spawned call, instead of dying with the old one. The caller is responsible for actually terminating the OLD controller’s own process first (via stop_for_replace, not stop) — this function only ever touches the registry map. See docs/specs/SPEC_BACKGROUND_TASK_TEARDOWN_SURVIVAL_2026_08_20.md.