|
7 | 7 | import static org.junit.jupiter.api.Assertions.*; |
8 | 8 |
|
9 | 9 | import java.util.HashMap; |
| 10 | +import java.util.List; |
10 | 11 | import java.util.Map; |
11 | 12 | import java.util.concurrent.CompletableFuture; |
12 | 13 | import java.util.concurrent.TimeUnit; |
13 | 14 |
|
14 | 15 | import org.junit.jupiter.api.AfterAll; |
15 | 16 | import org.junit.jupiter.api.BeforeAll; |
16 | | -import org.junit.jupiter.api.Disabled; |
17 | 17 | import org.junit.jupiter.api.Test; |
18 | 18 |
|
19 | 19 | import com.github.copilot.generated.ExitPlanModeAction; |
@@ -68,7 +68,6 @@ private void configureAuthenticatedUser(String testName) throws Exception { |
68 | 68 | } |
69 | 69 |
|
70 | 70 | @Test |
71 | | - @Disabled("Snapshot needs re-recording for CLI 1.0.57: https://github.com/github/copilot-sdk/issues/1547") |
72 | 71 | void shouldInvokeExitPlanModeHandlerWhenModelUsesTool() throws Exception { |
73 | 72 | final String summary = "Greeting file implementation plan"; |
74 | 73 | configureAuthenticatedUser("should_invoke_exit_plan_mode_handler_when_model_uses_tool"); |
@@ -103,16 +102,19 @@ void shouldInvokeExitPlanModeHandlerWhenModelUsesTool() throws Exception { |
103 | 102 |
|
104 | 103 | var request = handlerCalled.get(10, TimeUnit.SECONDS); |
105 | 104 | assertEquals(summary, request.getSummary()); |
106 | | - assertNotNull(request.getActions()); |
107 | | - assertTrue(request.getActions().contains("interactive")); |
| 105 | + // Canonical action order after CLI 1.0.57+ (aligned with #2023 / other SDKs). |
| 106 | + assertEquals(List.of("autopilot", "interactive", "exit_only"), request.getActions()); |
| 107 | + assertEquals("interactive", request.getRecommendedAction()); |
108 | 108 | assertNotNull(request.getPlanContent()); |
109 | 109 |
|
110 | 110 | var reqEvent = requestedEvent.get(10, TimeUnit.SECONDS); |
111 | 111 | assertEquals(request.getSummary(), reqEvent.getData().summary()); |
| 112 | + assertEquals(ExitPlanModeAction.INTERACTIVE, reqEvent.getData().recommendedAction()); |
112 | 113 |
|
113 | 114 | var compEvent = completedEvent.get(10, TimeUnit.SECONDS); |
114 | 115 | assertTrue(compEvent.getData().approved()); |
115 | 116 | assertEquals(ExitPlanModeAction.INTERACTIVE, compEvent.getData().selectedAction()); |
| 117 | + assertEquals("Approved by the Java E2E test", compEvent.getData().feedback()); |
116 | 118 |
|
117 | 119 | assertNotNull(response); |
118 | 120 |
|
|
0 commit comments