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) <noreply@anthropic.com>
This commit is contained in:
Nathan Flurry 2026-03-15 23:17:52 -07:00
parent 56c80e6c9e
commit f0ec8e497b

View file

@ -678,14 +678,17 @@ impl AgentManager {
}
fn agent_process_status(&self, agent: AgentId) -> Option<AgentProcessStatus> {
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,