1414
1515import org .junit .jupiter .api .AfterAll ;
1616import org .junit .jupiter .api .BeforeAll ;
17- import org .junit .jupiter .api .Disabled ;
1817import org .junit .jupiter .api .Test ;
1918
2019import 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