refactor(#1825): drop manager_dir/manager_socket_path, use the per-agent fns
This commit is contained in:
parent
a26bbb15fc
commit
77a9492a3f
2 changed files with 4 additions and 15 deletions
|
|
@ -1412,17 +1412,6 @@ impl Coordinator {
|
|||
Self::agent_dir(name).join("mcp.sock")
|
||||
}
|
||||
|
||||
/// Runtime dir for the manager. Uses the same per-agent subdir layout as
|
||||
/// sub-agents — the manager is just another agent under
|
||||
/// `AGENT_RUNTIME_ROOT` with its own subdirectory.
|
||||
pub fn manager_dir() -> PathBuf {
|
||||
Self::agent_dir(crate::lifecycle::MANAGER_NAME)
|
||||
}
|
||||
|
||||
pub fn manager_socket_path() -> PathBuf {
|
||||
Self::socket_path(crate::lifecycle::MANAGER_NAME)
|
||||
}
|
||||
|
||||
/// Ensure a runtime dir + (for sub-agents) per-agent socket exists. For
|
||||
/// the manager, `socket_server::start_manager` owns the socket — just return
|
||||
/// the dir. For sub-agents this is `register_agent` (creates a fresh
|
||||
|
|
|
|||
|
|
@ -75,14 +75,14 @@ pub fn start(agent: &str, socket_path: &Path, coord: Arc<Coordinator>) -> Result
|
|||
/// no authority of its own — it just serves requests as `agent = MANAGER_AGENT`
|
||||
/// ("ruth"), and ruth's reach comes entirely from being the topology root
|
||||
/// (`is_descendant_of` covers every agent) plus the capabilities / tool-groups
|
||||
/// it holds, identical to connecting on a per-agent socket. (The redundant
|
||||
/// path — ruth using the standard per-agent socket — is collapsed in a follow-up.)
|
||||
/// it holds, identical to connecting on a per-agent socket — ruth uses the
|
||||
/// standard per-agent runtime dir + socket, with no dedicated helpers.
|
||||
pub fn start_manager(coord: Arc<Coordinator>) -> Result<()> {
|
||||
use std::os::unix::fs::PermissionsExt as _;
|
||||
let dir = Coordinator::manager_dir();
|
||||
let dir = Coordinator::agent_dir(crate::lifecycle::MANAGER_NAME);
|
||||
std::fs::create_dir_all(&dir)
|
||||
.with_context(|| format!("create manager dir {}", dir.display()))?;
|
||||
let socket = Coordinator::manager_socket_path();
|
||||
let socket = Coordinator::socket_path(crate::lifecycle::MANAGER_NAME);
|
||||
if socket.exists() {
|
||||
std::fs::remove_file(&socket).context("remove stale manager socket")?;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue