davsclaus commented on code in PR #29939:
URL: https://github.com/apache/camel/pull/29939#discussion_r4574874582


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/ToolContext.java:
##########
@@ -360,18 +363,58 @@ public String executeAction(String action, 
Consumer<JsonObject> configure) {
             if (!result.isOk()) {
                 throw new ToolExecutionException(result.error());
             }
+            if (unescapeCodeLines(json)) {
+                return json.toJson();
+            }
         }
         return answer;
     }
 
     public JsonObject readErrorFile() {
         requireProcess();
-        return RuntimeHelper.readErrorFile(pid);
+        JsonObject errors = RuntimeHelper.readErrorFile(pid);
+        unescapeCodeLines(errors);
+        return errors;
     }
 
     public JsonObject readHistoryFile() {
         requireProcess();
-        return RuntimeHelper.readHistoryFile(pid);
+        JsonObject history = RuntimeHelper.readHistoryFile(pid);
+        unescapeCodeLines(history);
+        return history;
+    }
+
+    /**
+     * The lines of source code as they are in the file. The dev consoles 
escape each line of a {@code code} list, as
+     * JSON text in JSON, and the CLI commands undo it when they print the 
lines; the AI tools gave the lines as they
+     * came, so the agent saw {@code \"} that is not in the file (CAMEL-26932).

Review Comment:
   Done in 9007375a4bb2: the description is split into shorter sentences.
   
   _Claude Code on behalf of davsclaus_



-- 
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