From 519d6605f9ae3b43b84ccd8e67903eec24f8b936 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Fri, 16 Oct 2026 22:12:16 +0300 Subject: [PATCH] MCP: create the automation folder before claiming the startup lock On a profile that never ran the editor the folder did not exist, the lock write failed, and ocs_sessions(launch_if_none) took that as another caller starting the GUI: it never spawned one and kept answering "still starting". Closes #1846 Co-Authored-By: Claude Opus 5.5 --- src/mcp.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mcp.rs b/src/mcp.rs index adc430325..bc80b9694 100644 --- a/src/mcp.rs +++ b/src/mcp.rs @@ -854,6 +854,8 @@ fn now_unix_secs() -> u64 { fn write_startup_lock_at(directory: &Path, pid: u64, started: u64) -> Result<(), String> { let text = serde_json::to_string(&json!({"pid": pid, "started": started})) .map_err(|error| error.to_string())?; + // On a profile that never ran the editor nothing has made the folder yet. + std::fs::create_dir_all(directory).map_err(|error| error.to_string())?; std::fs::write(startup_lock_path_for(directory), text).map_err(|error| error.to_string()) }