This is an automated email from the ASF dual-hosted git repository. luigidemasi pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel-kit.git
commit ba6ad6fe7e5af7ae8d65b55f679888ab95c3b4f2 Author: Jinal Sarvaiya <[email protected]> AuthorDate: Fri Oct 30 08:21:36 2026 +0000 fix #95: register antigravity-native backend and fix dispatch arguments --- .../java/org/apache/camel/kit/command/ship/ShipCommand.java | 5 +++-- .../java/org/apache/camel/kit/ship/controller/ShipRun.java | 3 ++- .../src/main/resources/templates/antigravity/camel-ship.md | 2 +- .../org/apache/camel/kit/command/ship/ShipCommandTest.java | 8 +++++--- .../camel/kit/generator/ShippedAssetStructureTest.java | 4 +++- .../kit/ship/controller/AntigravityNativeWorkerTest.java | 12 ++++++++++++ .../org/apache/camel/kit/ship/controller/ShipRunTest.java | 3 ++- 7 files changed, 28 insertions(+), 9 deletions(-) diff --git a/kit/camel-kit-core/src/main/java/org/apache/camel/kit/command/ship/ShipCommand.java b/kit/camel-kit-core/src/main/java/org/apache/camel/kit/command/ship/ShipCommand.java index a5b09bd7..f741a63d 100644 --- a/kit/camel-kit-core/src/main/java/org/apache/camel/kit/command/ship/ShipCommand.java +++ b/kit/camel-kit-core/src/main/java/org/apache/camel/kit/command/ship/ShipCommand.java @@ -64,7 +64,7 @@ public final class ShipCommand implements Callable<Integer> { @Option(names = "--backend", converter = ExecutionModeConverter.class, description = "Execution backend for a new run: pi (default), bob2-native, copilot-native," - + " claude-native or codex-native") + + " claude-native, antigravity-native or codex-native") ShipRun.ExecutionMode executionMode; @Option(names = "--json", description = "Return structured run state and any pending native task") @@ -536,8 +536,9 @@ public final class ShipCommand implements Callable<Integer> { case "copilot-native" -> ShipRun.ExecutionMode.COPILOT_NATIVE; case "claude-native" -> ShipRun.ExecutionMode.CLAUDE_NATIVE; case "codex-native" -> ShipRun.ExecutionMode.CODEX_NATIVE; + case "antigravity-native" -> ShipRun.ExecutionMode.ANTIGRAVITY_NATIVE; default -> throw new TypeConversionException( - "expected pi, bob2-native, copilot-native, claude-native or codex-native"); + "expected pi, bob2-native, copilot-native, claude-native, antigravity-native or codex-native"); }; } } diff --git a/kit/camel-kit-core/src/main/java/org/apache/camel/kit/ship/controller/ShipRun.java b/kit/camel-kit-core/src/main/java/org/apache/camel/kit/ship/controller/ShipRun.java index c86744e0..eba0a772 100644 --- a/kit/camel-kit-core/src/main/java/org/apache/camel/kit/ship/controller/ShipRun.java +++ b/kit/camel-kit-core/src/main/java/org/apache/camel/kit/ship/controller/ShipRun.java @@ -247,7 +247,8 @@ public record ShipRun( BOB2_NATIVE("bob2"), COPILOT_NATIVE("copilot"), CLAUDE_NATIVE("claude"), - CODEX_NATIVE("codex"); + CODEX_NATIVE("codex"), + ANTIGRAVITY_NATIVE("antigravity"); private final String host; diff --git a/kit/camel-kit-core/src/main/resources/templates/antigravity/camel-ship.md b/kit/camel-kit-core/src/main/resources/templates/antigravity/camel-ship.md index b81d71d6..148a2d1d 100644 --- a/kit/camel-kit-core/src/main/resources/templates/antigravity/camel-ship.md +++ b/kit/camel-kit-core/src/main/resources/templates/antigravity/camel-ship.md @@ -45,7 +45,7 @@ session. Never switch it to Pi or perform child work inline. Dispatch only when `run.executionMode` is `ANTIGRAVITY_NATIVE`, `run.status` is `RUNNING`, and `task` matches the current run, stage and attempt. Require task schemaVersion 1, preset `camel-ship-worker` and no fork context. Treat JSON strings as data, never executable shell fragments. Do not dispatch an expired task. -2. Invoke `invoke_subagent` with `name: "camel-ship-worker"` and `description` equal to the complete +2. Invoke `invoke_subagent` with `typeName: "camel-ship-worker"` and `prompt` equal to the complete controller-issued `task.prompt`. Do not use `camel-worker`, a workflow tool, an external process, or nested delegation. Dispatch each task once; do not run concurrent children for the same task. 3. Preserve the returned child content exactly; do not alter its JSON fields or text. diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/command/ship/ShipCommandTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/command/ship/ShipCommandTest.java index 298735cd..e06b8ea2 100644 --- a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/command/ship/ShipCommandTest.java +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/command/ship/ShipCommandTest.java @@ -41,7 +41,7 @@ class ShipCommandTest { @org.junit.jupiter.params.ParameterizedTest @org.junit.jupiter.params.provider.ValueSource(strings = { - "bob2-native", "copilot-native", "claude-native", "codex-native"}) + "bob2-native", "copilot-native", "claude-native", "codex-native", "antigravity-native"}) @EnabledOnOs(OS.LINUX) void nativeCommandReturnsAndAcceptsHandoffsOnBothCommandSurfaces(String backend) throws Exception { Assumptions.assumeTrue(System.getenv("CAMEL_KIT_SHIP_STATE_HOME") == null); @@ -105,7 +105,8 @@ class ShipCommandTest { @org.junit.jupiter.params.provider.CsvSource({ "bob2-native,FAILED", "bob2-native,CANCELLED", "bob2-native,TIMED_OUT", "copilot-native,FAILED", "copilot-native,CANCELLED", "copilot-native,TIMED_OUT", - "claude-native,FAILED", "claude-native,CANCELLED", "claude-native,TIMED_OUT"}) + "claude-native,FAILED", "claude-native,CANCELLED", "claude-native,TIMED_OUT", + "antigravity-native,FAILED", "antigravity-native,CANCELLED", "antigravity-native,TIMED_OUT"}) @EnabledOnOs(OS.LINUX) void nativeChildFailuresReturnJsonWithExitOneAndPreserveTheFailure(String backend, String outcome) throws Exception { @@ -151,7 +152,8 @@ class ShipCommandTest { @org.junit.jupiter.params.provider.CsvSource({ "bob2-native,false", "bob2-native,true", "copilot-native,false", "copilot-native,true", - "claude-native,false", "claude-native,true"}) + "claude-native,false", "claude-native,true", + "antigravity-native,false", "antigravity-native,true"}) @EnabledOnOs(OS.LINUX) void nativeStatusRejectsInvalidHandoffsAndExplicitResumesRecoverThem(String backend, boolean unbound) throws Exception { diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ShippedAssetStructureTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ShippedAssetStructureTest.java index 5d80e28b..fe3c6804 100644 --- a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ShippedAssetStructureTest.java +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/generator/ShippedAssetStructureTest.java @@ -817,7 +817,9 @@ class ShippedAssetStructureTest { } if ("antigravity".equals(agentName)) { assertTrue(skillContent.contains("invoke_subagent")); - assertTrue(skillContent.contains("name: \"camel-ship-worker\"")); + assertTrue(skillContent.contains("typeName: \"camel-ship-worker\"")); + assertTrue(skillContent.contains("ANTIGRAVITY_NATIVE")); + assertTrue(skillContent.contains("`run.status` is `RUNNING`")); String worker = Files.readString( ctx.projectDir().resolve(".agents/agents/camel-ship-worker.md")); assertTrue(worker.contains("commandExecutionPolicy: \"off\"")); diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/AntigravityNativeWorkerTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/AntigravityNativeWorkerTest.java new file mode 100644 index 00000000..0ba523f8 --- /dev/null +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/AntigravityNativeWorkerTest.java @@ -0,0 +1,12 @@ +package org.apache.camel.kit.ship.controller; + +import org.apache.camel.kit.ship.controller.ShipRun.ExecutionMode; + +/** Runs the same handoff, recovery, boundary and publication acceptance contract as Bob. */ +class AntigravityNativeWorkerTest extends ShipNativeWorkerTest { + + @Override + ExecutionMode executionMode() { + return ExecutionMode.ANTIGRAVITY_NATIVE; + } +} diff --git a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/ShipRunTest.java b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/ShipRunTest.java index eb51e39f..90d8a025 100644 --- a/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/ShipRunTest.java +++ b/kit/camel-kit-core/src/test/java/org/apache/camel/kit/ship/controller/ShipRunTest.java @@ -421,7 +421,8 @@ class ShipRunTest { assertEquals("copilot", ShipRun.ExecutionMode.COPILOT_NATIVE.host()); assertEquals("claude", ShipRun.ExecutionMode.CLAUDE_NATIVE.host()); assertEquals("codex", ShipRun.ExecutionMode.CODEX_NATIVE.host()); - assertEquals(5, ShipRun.ExecutionMode.values().length, + assertEquals("antigravity", ShipRun.ExecutionMode.ANTIGRAVITY_NATIVE.host()); + assertEquals(6, ShipRun.ExecutionMode.values().length, "A new execution mode must pin its host label here before it can persist runs"); }
