harness: remove deprecated manager-side request_spawn surface (closes #442)
This commit is contained in:
parent
03d39788d9
commit
dca62fda40
8 changed files with 56 additions and 124 deletions
|
|
@ -203,34 +203,6 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
|
|||
},
|
||||
}
|
||||
}
|
||||
ManagerRequest::RequestSpawn { name, description } => {
|
||||
tracing::info!(%name, "manager: request_spawn");
|
||||
let proposed_dir = crate::coordinator::Coordinator::agent_proposed_dir(name);
|
||||
if !proposed_dir.join(".git").exists() {
|
||||
return ManagerResponse::Err {
|
||||
message: format!(
|
||||
"no proposed config repo found for '{name}' - \
|
||||
call request_init_config first to initialise and customise \
|
||||
the config before spawning"
|
||||
),
|
||||
};
|
||||
}
|
||||
match coord.approvals.submit_kind(
|
||||
name,
|
||||
hive_sh4re::ApprovalKind::Spawn,
|
||||
"",
|
||||
description.as_deref(),
|
||||
) {
|
||||
Ok(id) => {
|
||||
tracing::info!(%id, %name, "spawn approval queued");
|
||||
coord.emit_approval_added(id, name, "spawn", None, None, description.clone());
|
||||
ManagerResponse::Ok
|
||||
}
|
||||
Err(e) => ManagerResponse::Err {
|
||||
message: format!("{e:#}"),
|
||||
},
|
||||
}
|
||||
}
|
||||
ManagerRequest::Kill { name } => {
|
||||
tracing::info!(%name, "manager: kill");
|
||||
if name == crate::lifecycle::MANAGER_NAME {
|
||||
|
|
|
|||
|
|
@ -568,16 +568,19 @@ async fn dispatch(
|
|||
crate::actions::run_approval_spawn(coord, Some(entry.id), approval_id).await
|
||||
}
|
||||
(QueueKind::Spawn, None) => {
|
||||
// No non-approval Spawn caller today. The variant exists so
|
||||
// operator-triggered `RequestSpawn` (deprecated) and the
|
||||
// future direct-spawn admin path can route through here
|
||||
// without a wire change.
|
||||
tracing::debug!(
|
||||
id = entry.id,
|
||||
agent = %entry.agent,
|
||||
"rebuild_queue: Spawn entry without approval_id is a no-op"
|
||||
);
|
||||
Ok(())
|
||||
// Unreachable today: every Spawn entry is born from an
|
||||
// approval (HostRequest::RequestSpawn → submit_kind →
|
||||
// approve → enqueue with approval_id). The manager-side
|
||||
// `RequestSpawn` surface that used to bypass approvals
|
||||
// was removed in #442; if a future direct-spawn admin
|
||||
// path needs to skip the approval ride it should wire
|
||||
// its own action call rather than route through here.
|
||||
anyhow::bail!(
|
||||
"rebuild_queue: Spawn entry id={} agent={} arrived without an approval_id — \
|
||||
nothing should enqueue this shape today",
|
||||
entry.id,
|
||||
entry.agent,
|
||||
)
|
||||
}
|
||||
(QueueKind::Destroy, _) => {
|
||||
// Reserved for future `destroy --purge` integration.
|
||||
|
|
|
|||
Loading…
Reference in a new issue