From 736593c516da17dd9c19bba70827100dad32fe53 Mon Sep 17 00:00:00 2001 From: jade Date: Mon, 20 Jul 2026 10:15:07 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20Deep=20Agent=20Builder=20=EB=AC=B4?= =?UTF-8?q?=ED=95=9C=20=EB=8C=80=EA=B8=B0=20=ED=98=84=EC=83=81=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0=EC=9D=84=20=EC=9C=84=ED=95=B4=20JSON-RPC=20Notificati?= =?UTF-8?q?on=20=EC=B2=98=EB=A6=AC=20=ED=9B=84=20SSE=20=EA=B0=95=EC=A0=9C?= =?UTF-8?q?=20=EC=A2=85=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sync/CustomWebMvcSseServerTransportProvider.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dap-gateway/src/main/java/io/shinhanlife/dap/biz/mcp/gateway/sync/CustomWebMvcSseServerTransportProvider.java b/dap-gateway/src/main/java/io/shinhanlife/dap/biz/mcp/gateway/sync/CustomWebMvcSseServerTransportProvider.java index 5846aef..5037349 100644 --- a/dap-gateway/src/main/java/io/shinhanlife/dap/biz/mcp/gateway/sync/CustomWebMvcSseServerTransportProvider.java +++ b/dap-gateway/src/main/java/io/shinhanlife/dap/biz/mcp/gateway/sync/CustomWebMvcSseServerTransportProvider.java @@ -139,7 +139,7 @@ public class CustomWebMvcSseServerTransportProvider implements McpServerTranspor try { // Body로 들어온 메시지 즉시 비동기 처리 if (body != null && !body.trim().isEmpty()) { - handleMessage(sessionId, body); + handleMessage(sessionId, body, emitter); } } catch (Exception e) { emitter.completeWithError(e); @@ -150,6 +150,10 @@ public class CustomWebMvcSseServerTransportProvider implements McpServerTranspor } public org.springframework.http.ResponseEntity handleMessage(String sessionId, String body) { + return handleMessage(sessionId, body, null); + } + + public org.springframework.http.ResponseEntity handleMessage(String sessionId, String body, org.springframework.web.servlet.mvc.method.annotation.SseEmitter emitter) { log.info("Received POST message for sessionId: " + sessionId + ", body: " + body); if (sessionId == null || !sessions.containsKey(sessionId)) { return ResponseEntity.badRequest().body("Unexpected request body"); @@ -173,6 +177,12 @@ public class CustomWebMvcSseServerTransportProvider implements McpServerTranspor session.handle(message).subscribe(); log.info("Message sent to session handler"); + + if (emitter != null && !map.containsKey("id")) { + emitter.complete(); + log.info("Completed emitter for notification"); + } + return ResponseEntity.ok().build(); } catch (Exception e) { log.error("Failed to handle message", e);