From f0ec8e497b952b8ee43693b3c1feca58b819c52f Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Sun, 15 Mar 2026 23:17:52 -0700 Subject: [PATCH] fix: mock agent process launcher not written during install agent_process_status() for mock always returned Some(...) even when the launcher file did not exist. This caused install_agent_process() to short-circuit with "already installed" and never write the launcher script. Fix by checking that the launcher file exists before reporting the mock agent as installed. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/packages/agent-management/src/agents.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/server/packages/agent-management/src/agents.rs b/server/packages/agent-management/src/agents.rs index fa7e243..785603d 100644 --- a/server/packages/agent-management/src/agents.rs +++ b/server/packages/agent-management/src/agents.rs @@ -678,14 +678,17 @@ impl AgentManager { } fn agent_process_status(&self, agent: AgentId) -> Option { - if agent == AgentId::Mock { - return Some(AgentProcessStatus { - source: InstallSource::Builtin, - version: Some("builtin".to_string()), - }); - } - let launcher = self.agent_process_path(agent); + + if agent == AgentId::Mock { + if launcher.exists() { + return Some(AgentProcessStatus { + source: InstallSource::Builtin, + version: Some("builtin".to_string()), + }); + } + return None; + } if launcher.exists() { return Some(AgentProcessStatus { source: InstallSource::LocalPath,