refactor(#1825): drop MANAGER_NAME special-cases in crash_watch + tombstones

This commit is contained in:
damocles 2026-06-23 17:45:05 +02:00 committed by mara
commit 12ed5da11a
3 changed files with 9 additions and 13 deletions

View file

@ -9,7 +9,7 @@ use std::time::Duration;
use crate::container_view::claude_has_session; use crate::container_view::claude_has_session;
use crate::coordinator::{Coordinator, TransientKind}; use crate::coordinator::{Coordinator, TransientKind};
use crate::lifecycle::{self, AGENT_PREFIX, MANAGER_NAME}; use crate::lifecycle::{self, AGENT_PREFIX};
const POLL_INTERVAL: Duration = Duration::from_secs(10); const POLL_INTERVAL: Duration = Duration::from_secs(10);
@ -37,15 +37,11 @@ pub fn spawn(coord: Arc<Coordinator>) {
continue; continue;
}; };
let logical = logical.to_owned(); let logical = logical.to_owned();
if logical != MANAGER_NAME { sub_agents.push(logical.clone());
sub_agents.push(logical.clone());
}
if lifecycle::is_running(&logical).await { if lifecycle::is_running(&logical).await {
current_running.insert(logical.clone()); current_running.insert(logical.clone());
} }
if logical != MANAGER_NAME if claude_has_session(&Coordinator::agent_claude_dir(&logical)) {
&& claude_has_session(&Coordinator::agent_claude_dir(&logical))
{
current_logged_in.insert(logical.clone()); current_logged_in.insert(logical.clone());
} }
} }

View file

@ -979,9 +979,8 @@ async fn build_approval_views(approvals: Vec<Approval>) -> Vec<ApprovalView> {
out out
} }
/// State-dir names that don't appear in the live container list (and /// State-dir names that don't appear in the live container list. Each
/// aren't the manager). Each one surfaces in the dashboard as a row /// one surfaces in the dashboard as a row with R3V1V3 + PURG3 actions.
/// with R3V1V3 + PURG3 actions.
fn build_tombstone_views( fn build_tombstone_views(
coord: &Coordinator, coord: &Coordinator,
containers: &[ContainerView], containers: &[ContainerView],
@ -995,7 +994,7 @@ fn build_tombstone_views(
.collect(); .collect();
Coordinator::kept_state_names() Coordinator::kept_state_names()
.into_iter() .into_iter()
.filter(|name| name != MANAGER_NAME && !live.contains(name.as_str())) .filter(|name| !live.contains(name.as_str()))
.map(|name| { .map(|name| {
let root = Coordinator::agent_state_root(&name); let root = Coordinator::agent_state_root(&name);
let state_bytes = dir_size_bytes(&root); let state_bytes = dir_size_bytes(&root);

View file

@ -315,8 +315,9 @@ pub fn apply_add_child(
} }
/// Reconcile `topology.json` against the current agent set. Adds an /// Reconcile `topology.json` against the current agent set. Adds an
/// entry (default: parent = manager, manager itself = root) for any /// entry (default: parent = null — a new agent with no declared parent
/// agent missing from the file; removes entries for agents no longer /// is its own root) for any agent missing from the file; removes
/// entries for agents no longer
/// present. Existing entries are preserved as-is — operator/manager /// present. Existing entries are preserved as-is — operator/manager
/// choices stick across regenerations. Returns true when the file /// choices stick across regenerations. Returns true when the file
/// changed and should be re-committed by the caller. /// changed and should be re-committed by the caller.