Skip to content

Commit 79accd3

Browse files
Copilotedburns
andauthored
Enable instructionDirectories E2E tests and fix getSystemMessage exchange parsing
Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/cad2855d-0ec3-43e1-acef-49e96848b902 Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
1 parent fce9527 commit 79accd3

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/test/java/com/github/copilot/sdk/SessionConfigE2ETest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
import org.junit.jupiter.api.AfterAll;
1616
import org.junit.jupiter.api.BeforeAll;
17-
import org.junit.jupiter.api.Disabled;
1817
import org.junit.jupiter.api.Test;
1918

2019
import com.github.copilot.sdk.json.MessageOptions;
@@ -41,7 +40,6 @@ static void teardown() throws Exception {
4140
}
4241
}
4342

44-
@Disabled("Requires test harness update with instructionDirectories snapshots - see reference impl PR #1190")
4543
@Test
4644
void testShouldApplyInstructionDirectoriesOnCreate() throws Exception {
4745
ctx.configureForTest("session_config", "should_apply_instructiondirectories_on_create");
@@ -71,7 +69,6 @@ void testShouldApplyInstructionDirectoriesOnCreate() throws Exception {
7169
}
7270
}
7371

74-
@Disabled("Requires test harness update with instructionDirectories snapshots - see reference impl PR #1190")
7572
@Test
7673
void testShouldApplyInstructionDirectoriesOnResume() throws Exception {
7774
ctx.configureForTest("session_config", "should_apply_instructiondirectories_on_resume");
@@ -111,7 +108,13 @@ void testShouldApplyInstructionDirectoriesOnResume() throws Exception {
111108

112109
@SuppressWarnings("unchecked")
113110
private static String getSystemMessage(Map<String, Object> exchange) {
114-
Object messagesObj = exchange.get("messages");
111+
// The exchange structure is: { request: { messages: [...] }, response: ...,
112+
// requestHeaders: ... }
113+
Object requestObj = exchange.get("request");
114+
if (!(requestObj instanceof Map<?, ?> request)) {
115+
return null;
116+
}
117+
Object messagesObj = request.get("messages");
115118
if (messagesObj instanceof List<?> messages) {
116119
for (Object msg : messages) {
117120
if (msg instanceof Map<?, ?> msgMap) {

0 commit comments

Comments
 (0)