@@ -271,6 +271,17 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
271271 blocking = false ;
272272 }
273273
274+ // Log blocking behavior from client request
275+ if (params .configuration () != null && params .configuration ().blocking () != null ) {
276+ LOGGER .info ("DefaultRequestHandler: Client requested blocking={} for task {}" ,
277+ params .configuration ().blocking (), taskId );
278+ } else if (params .configuration () != null ) {
279+ LOGGER .info ("DefaultRequestHandler: Client sent configuration but blocking=null, using default blocking=true for task {}" , taskId );
280+ } else {
281+ LOGGER .info ("DefaultRequestHandler: Client sent no configuration, using default blocking=true for task {}" , taskId );
282+ }
283+ LOGGER .info ("DefaultRequestHandler: Final blocking decision: {} for task {}" , blocking , taskId );
284+
274285 boolean interruptedOrNonBlocking = false ;
275286
276287 EnhancedRunnable producerRunnable = registerAndExecuteAgentAsync (taskId , mss .requestContext , queue );
@@ -292,7 +303,8 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
292303 throw new InternalError ("No result" );
293304 }
294305 interruptedOrNonBlocking = etai .interrupted ();
295- LOGGER .debug ("Was interrupted or non-blocking: {}" , interruptedOrNonBlocking );
306+ LOGGER .info ("DefaultRequestHandler: interruptedOrNonBlocking={} (blocking={}, eventType={})" ,
307+ interruptedOrNonBlocking , blocking , kind != null ? kind .getClass ().getSimpleName () : null );
296308
297309 // For blocking calls that were interrupted (returned on first event),
298310 // wait for agent execution and event processing BEFORE returning to client.
@@ -316,29 +328,31 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
316328 // 2. Close the queue to signal consumption can complete
317329 // 3. Wait for consumption to finish processing events
318330 // 4. Fetch final task state from TaskStore
331+ LOGGER .info ("DefaultRequestHandler: Entering blocking fire-and-forget handling for task {}" , taskId );
319332
320333 try {
321334 // Step 1: Wait for agent to finish (with configurable timeout)
322335 if (agentFuture != null ) {
323336 try {
324337 agentFuture .get (agentCompletionTimeoutSeconds , SECONDS );
325- LOGGER .debug ( " Agent completed for task {}" , taskId );
338+ LOGGER .info ( "DefaultRequestHandler: Step 1 - Agent completed for task {}" , taskId );
326339 } catch (java .util .concurrent .TimeoutException e ) {
327340 // Agent still running after timeout - that's fine, events already being processed
328- LOGGER .debug ("Agent still running for task {} after {}s" , taskId , agentCompletionTimeoutSeconds );
341+ LOGGER .info ("DefaultRequestHandler: Step 1 - Agent still running for task {} after {}s timeout" ,
342+ taskId , agentCompletionTimeoutSeconds );
329343 }
330344 }
331345
332346 // Step 2: Close the queue to signal consumption can complete
333347 // For fire-and-forget tasks, there's no final event, so we need to close the queue
334348 // This allows EventConsumer.consumeAll() to exit
335349 queue .close (false , false ); // graceful close, don't notify parent yet
336- LOGGER .debug ( " Closed queue for task {} to allow consumption completion" , taskId );
350+ LOGGER .info ( "DefaultRequestHandler: Step 2 - Closed queue for task {} to allow consumption completion" , taskId );
337351
338352 // Step 3: Wait for consumption to complete (now that queue is closed)
339353 if (etai .consumptionFuture () != null ) {
340354 etai .consumptionFuture ().get (consumptionCompletionTimeoutSeconds , SECONDS );
341- LOGGER .debug ( " Consumption completed for task {}" , taskId );
355+ LOGGER .info ( "DefaultRequestHandler: Step 3 - Consumption completed for task {}" , taskId );
342356 }
343357 } catch (InterruptedException e ) {
344358 Thread .currentThread ().interrupt ();
@@ -359,11 +373,11 @@ public EventKind onMessageSend(MessageSendParams params, ServerCallContext conte
359373 Task updatedTask = taskStore .get (taskId );
360374 if (updatedTask != null ) {
361375 kind = updatedTask ;
362- if ( LOGGER .isDebugEnabled ()) {
363- LOGGER . debug ( "Fetched final task for {} with state {} and {} artifacts" ,
364- taskId , updatedTask .getStatus ().state (),
365- updatedTask . getArtifacts (). size ());
366- }
376+ LOGGER .info ( "DefaultRequestHandler: Step 4 - Fetched final task for {} with state {} and {} artifacts" ,
377+ taskId , updatedTask . getStatus (). state () ,
378+ updatedTask .getArtifacts ().size ());
379+ } else {
380+ LOGGER . warn ( "DefaultRequestHandler: Step 4 - Task {} not found in TaskStore!" , taskId );
367381 }
368382 }
369383 if (kind instanceof Task taskResult && !taskId .equals (taskResult .getId ())) {
0 commit comments