Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
371f888640 | ||
|
|
dfd159d1de |
2 changed files with 3 additions and 21 deletions
|
|
@ -548,8 +548,8 @@ impl Coordinator {
|
||||||
/// Assemble the per-agent filesystem paths for `name`. `agent_dir`
|
/// Assemble the per-agent filesystem paths for `name`. `agent_dir`
|
||||||
/// is the runtime directory (`/run/hyperhive/agents/<name>`), obtained
|
/// is the runtime directory (`/run/hyperhive/agents/<name>`), obtained
|
||||||
/// from `Coordinator::agent_dir(name)` (pure path) or from
|
/// from `Coordinator::agent_dir(name)` (pure path) or from
|
||||||
/// `lifecycle::ensure_agent_runtime_dir` + `agent_dir` when the dir
|
/// `lifecycle::ensure_agent_runtime_dir(name)` when the dir must be
|
||||||
/// must be created. All other paths are derived statically from `name`.
|
/// created. All other paths are derived statically from `name`.
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn agent_paths(name: &str, agent_dir: PathBuf) -> AgentPaths {
|
pub fn agent_paths(name: &str, agent_dir: PathBuf) -> AgentPaths {
|
||||||
AgentPaths {
|
AgentPaths {
|
||||||
|
|
@ -1452,24 +1452,6 @@ impl Coordinator {
|
||||||
|
|
||||||
/// Ensure a runtime dir + (for sub-agents) per-agent socket exists.
|
/// 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.).
|
/// Per-agent state root (parent of `config/`, future `prompts/`, etc.).
|
||||||
pub fn agent_state_root(name: &str) -> PathBuf {
|
pub fn agent_state_root(name: &str) -> PathBuf {
|
||||||
PathBuf::from(format!("{AGENT_STATE_ROOT}/{name}"))
|
PathBuf::from(format!("{AGENT_STATE_ROOT}/{name}"))
|
||||||
|
|
|
||||||
|
|
@ -1530,7 +1530,7 @@ fn write_bridge_dns_marker(container: &str, isolation: Option<&NetworkIsolation>
|
||||||
/// then creates any missing dirs on the running host. The file survives reboots
|
/// then creates any missing dirs on the running host. The file survives reboots
|
||||||
/// and is read by `systemd-tmpfiles-setup.service` (runs in `sysinit.target`,
|
/// and is read by `systemd-tmpfiles-setup.service` (runs in `sysinit.target`,
|
||||||
/// before any container units can start), so bind-mount source dirs are always
|
/// before any container units can start), so bind-mount source dirs are always
|
||||||
/// pre-created regardless of whether hive-c0re has reached `ensure_runtime`.
|
/// pre-created regardless of whether hive-c0re has reached `ensure_agent_runtime_dir`.
|
||||||
///
|
///
|
||||||
/// Directories written per agent:
|
/// Directories written per agent:
|
||||||
/// - `/run/hyperhive/agents/<name>` (MCP socket dir, bind-mounted into container
|
/// - `/run/hyperhive/agents/<name>` (MCP socket dir, bind-mounted into container
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue