etzel-mes commented on code in PR #30336:
URL: https://github.com/apache/camel/pull/30336#discussion_r4612296591


##########
components/camel-ai/camel-ai-prompt/src/main/java/org/apache/camel/component/ai/prompt/AiPromptExecutor.java:
##########
@@ -48,6 +48,13 @@ public static AiPromptResult execute(AiPromptSpec spec, 
Map<String, String> argu
                     "No consumer available for prompt '" + promptName + "'",
                     new IllegalStateException("No consumer available"));
         }
+        // A suspended prompt (suspended route, graceful shutdown) refuses new 
requests, as request/reply consumers do
+        // while suspended; a caller may hold its spec from before the 
suspend. Requests in flight are past this point.
+        if (consumer.isSuspendingOrSuspended()) {
+            return new AiPromptResult.ExecutionError(
+                    "Prompt '" + promptName + "' is suspended",
+                    new IllegalStateException("Prompt is suspended"));
+        }
         Processor processor = consumer.getProcessor();

Review Comment:
   Fixed in 17cf7882212: the cause now carries the prompt name, as in the tool 
and resource executors, and the test asserts the cause's message too.
   
   Applied by hand rather than through the suggestion: as written it also 
removes the `Processor processor = consumer.getProcessor();` line below the 
block, which the next statement needs.
   
   _Claude Code on behalf of etzel-mes_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to