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::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);
@ -37,15 +37,11 @@ pub fn spawn(coord: Arc<Coordinator>) {
continue;
};
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 {
current_running.insert(logical.clone());
}
if logical != MANAGER_NAME
&& claude_has_session(&Coordinator::agent_claude_dir(&logical))
{
if claude_has_session(&Coordinator::agent_claude_dir(&logical)) {
current_logged_in.insert(logical.clone());
}
}

View file

@ -979,9 +979,8 @@ async fn build_approval_views(approvals: Vec<Approval>) -> Vec<ApprovalView> {
out
}
/// State-dir names that don't appear in the live container list (and
/// aren't the manager). Each one surfaces in the dashboard as a row
/// with R3V1V3 + PURG3 actions.
/// State-dir names that don't appear in the live container list. Each
/// one surfaces in the dashboard as a row with R3V1V3 + PURG3 actions.
fn build_tombstone_views(
coord: &Coordinator,
containers: &[ContainerView],
@ -995,7 +994,7 @@ fn build_tombstone_views(
.collect();
Coordinator::kept_state_names()
.into_iter()
.filter(|name| name != MANAGER_NAME && !live.contains(name.as_str()))
.filter(|name| !live.contains(name.as_str()))
.map(|name| {
let root = Coordinator::agent_state_root(&name);
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
/// entry (default: parent = manager, manager itself = root) for any
/// agent missing from the file; removes entries for agents no longer
/// entry (default: parent = null — a new agent with no declared parent
/// 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
/// choices stick across regenerations. Returns true when the file
/// changed and should be re-committed by the caller.