This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cayenne.git
The following commit(s) were added to refs/heads/master by this push:
new 9cc39ca35 CAY-2943 CayenneModeler MCP: open_project tool
9cc39ca35 is described below
commit 9cc39ca356b8d1fd763b61634051944168ed9a76
Author: Andrus Adamchik <[email protected]>
AuthorDate: Sat May 23 09:27:07 2026 -0400
CAY-2943 CayenneModeler MCP: open_project tool
do not check whether the process is alive .. it is not reliable across
platforms
---
.../cayenne/mcp/tools/openproject/ModelerLauncher.java | 9 ++-------
.../cayenne/mcp/tools/openproject/OpenProjectTool.java | 13 ++-----------
2 files changed, 4 insertions(+), 18 deletions(-)
diff --git
a/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/ModelerLauncher.java
b/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/ModelerLauncher.java
index 515e3cb89..9f02b0a03 100644
---
a/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/ModelerLauncher.java
+++
b/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/ModelerLauncher.java
@@ -33,7 +33,7 @@ import java.util.List;
*/
final class ModelerLauncher {
- record LaunchResult(Process process, List<String> command, boolean
processAlivenessMeaningful) {}
+ record LaunchResult(Process process, List<String> command) {}
private ModelerLauncher() {
}
@@ -80,12 +80,7 @@ final class ModelerLauncher {
Process process = pb.start();
- // Process.isAlive() only carries signal for processes we own
end-to-end.
- // On Mac, the process we spawn is `open`, which exits in milliseconds
with
- // no relationship to whether the Modeler actually started.
- boolean alivenessMeaningful = kind != LauncherKind.MAC_APP;
-
- return new LaunchResult(process, command, alivenessMeaningful);
+ return new LaunchResult(process, command);
}
private static Path workingDirectory(LauncherKind kind, Path launcher) {
diff --git
a/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/OpenProjectTool.java
b/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/OpenProjectTool.java
index c67a179be..6ab3e75d7 100644
---
a/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/OpenProjectTool.java
+++
b/cayenne-mcp-server/src/main/java/org/apache/cayenne/mcp/tools/openproject/OpenProjectTool.java
@@ -42,7 +42,6 @@ import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
-import java.util.function.BooleanSupplier;
/**
* MCP tool that launches CayenneModeler with a project file pre-loaded. The
tool
@@ -172,10 +171,7 @@ public class OpenProjectTool {
launch.command());
// Step 5 — wait for the handshake.
- BooleanSupplier alive = launch.processAlivenessMeaningful()
- ? () -> launch.process().isAlive()
- : () -> true;
- WatchResult watch = HandshakeWatcher.await(nonce, alive,
HANDSHAKE_TIMEOUT);
+ WatchResult watch = HandshakeWatcher.await(nonce, () -> true,
HANDSHAKE_TIMEOUT);
return switch (watch.outcome()) {
case HANDSHAKE_RECEIVED -> {
@@ -210,18 +206,13 @@ public class OpenProjectTool {
.formatted(exit)));
}
case TIMEOUT -> {
- boolean stillAlive = launch.processAlivenessMeaningful() &&
launch.process().isAlive();
- String hint = stillAlive
- ? "Modeler process is still running but did not
confirm opening the project — check the Modeler window for an error dialog"
- : "Modeler process is not alive at the timeout
boundary";
yield new OpenProjectResult(
"error",
resolved,
allPassed,
null,
new
OpenProjectError(OpenProjectErrorCode.launch_not_confirmed,
- "Handshake did not appear within %ds.
%s.".formatted(
- HANDSHAKE_TIMEOUT.toSeconds(), hint)));
+ "Handshake did not appear within
%ds".formatted(HANDSHAKE_TIMEOUT.toSeconds())));
}
};
}