Revert to direct content return for screen execution - opencode expects direct response
Showing
1 changed file
with
1 additions
and
21 deletions
| ... | @@ -1127,27 +1127,7 @@ def startTime = System.currentTimeMillis() | ... | @@ -1127,27 +1127,7 @@ def startTime = System.currentTimeMillis() |
| 1127 | isError: false | 1127 | isError: false |
| 1128 | ] | 1128 | ] |
| 1129 | 1129 | ||
| 1130 | // Queue result as notification for real-time delivery | 1130 | ec.logger.info("MCP Screen Execution: Returned result directly for screen ${screenPath} in ${executionTime}s") |
| 1131 | try { | ||
| 1132 | def servlet = ec.getWeb()?.getServletContext()?.getAttribute("enhancedMcpServlet") | ||
| 1133 | if (servlet && sessionId) { | ||
| 1134 | def notification = [ | ||
| 1135 | method: "notifications/tool_result", | ||
| 1136 | params: [ | ||
| 1137 | toolName: "screen_" + screenPath.replace("/", "_").replace(".", "_"), | ||
| 1138 | result: result, | ||
| 1139 | executionTime: executionTime, | ||
| 1140 | timestamp: System.currentTimeMillis() | ||
| 1141 | ] | ||
| 1142 | ] | ||
| 1143 | servlet.queueNotification(sessionId, notification) | ||
| 1144 | ec.logger.info("MCP Screen Execution: Queued result as notification for screen ${screenPath} in ${executionTime}s") | ||
| 1145 | } else { | ||
| 1146 | ec.logger.warn("MCP Screen Execution: No servlet or sessionId available for notification queuing") | ||
| 1147 | } | ||
| 1148 | } catch (Exception e) { | ||
| 1149 | ec.logger.warn("MCP Screen Execution: Failed to queue notification: ${e.message}") | ||
| 1150 | } | ||
| 1151 | ]]></script> | 1131 | ]]></script> |
| 1152 | </actions> | 1132 | </actions> |
| 1153 | </service> | 1133 | </service> | ... | ... |
-
Please register or sign in to post a comment