refactor: drop Coordinator::ensure_runtime dead shim (no callers post #2290)

This commit is contained in:
atlas 2026-07-10 01:12:04 +02:00
commit dfd159d1de

View file

@ -548,8 +548,8 @@ impl Coordinator {
/// Assemble the per-agent filesystem paths for `name`. `agent_dir`
/// is the runtime directory (`/run/hyperhive/agents/<name>`), obtained
/// from `Coordinator::agent_dir(name)` (pure path) or from
/// `lifecycle::ensure_agent_runtime_dir` + `agent_dir` when the dir
/// must be created. All other paths are derived statically from `name`.
/// `lifecycle::ensure_agent_runtime_dir(name)` when the dir must be
/// created. All other paths are derived statically from `name`.
#[must_use]
pub fn agent_paths(name: &str, agent_dir: PathBuf) -> AgentPaths {
AgentPaths {
@ -1452,24 +1452,6 @@ impl Coordinator {
/// Ensure a runtime dir + (for sub-agents) per-agent socket exists.
///
/// **Prefer the split form (event-driven):**
/// - dir creation → `lifecycle::ensure_agent_runtime_dir(name)`
/// - listener registration → `register_agent(name)` at each explicit
/// lifecycle event (spawn, reconcile-start). `mcp_sockets::sync_on_start`
/// covers the daemon-restart case.
///
/// This method is kept as a convenience shim for any remaining callers
/// that need the combined semantics in one call.
pub fn ensure_runtime(self: &Arc<Self>, name: &str) -> Result<PathBuf> {
if name == crate::lifecycle::MANAGER_NAME {
let dir = Self::agent_dir(name);
std::fs::create_dir_all(&dir)
.with_context(|| format!("create manager dir {}", dir.display()))?;
return Ok(dir);
}
self.register_agent(name)
}
/// Per-agent state root (parent of `config/`, future `prompts/`, etc.).
pub fn agent_state_root(name: &str) -> PathBuf {
PathBuf::from(format!("{AGENT_STATE_ROOT}/{name}"))