diff --git a/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx b/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx index b24cc6a9..6da04c0a 100644 --- a/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx +++ b/frontend/packages/swarm-ui/src/pages/AgentsPage.tsx @@ -329,17 +329,27 @@ export function AgentsPage() { // Already destroyed, or nothing to destroy against — same guard // shape as the wanted toggle's own `!a.hive` check. const destroyable = a.hive && a.wanted !== "destroyed"; + const destroyed = a.wanted === "destroyed"; return ( <> void toggleWanted(a) : undefined} - disabled={pending || !a.hive} + // `destroyed` blocks the click too, not just the label — + // argus caught this in review: without it, a click here + // still computed `target = "up"` and PUT a live + // declaration on a destroyed row, contradicting the + // destroy confirm's own "not reversible from here" copy. + onClick={ + a.hive && !destroyed ? () => void toggleWanted(a) : undefined + } + disabled={pending || !a.hive || destroyed} title={ - a.hive - ? `click to ${actionLabel} ${a.name}` - : "no hive on record for this agent — nothing to declare against" + destroyed + ? `${a.name} is destroyed — redeploy via "+ agent" to bring it back` + : a.hive + ? `click to ${actionLabel} ${a.name}` + : "no hive on record for this agent — nothing to declare against" } /> {destroyable ? (