gnodet-bot commented on code in PR #29962:
URL: https://github.com/apache/camel/pull/29962#discussion_r4575162300


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ai/RepeatedToolCalls.java:
##########
@@ -86,6 +91,24 @@ public synchronized JsonObject repeatOf(ToolDescriptor tool, 
Map<String, ?> args
         note.put("repeated", true);
         note.put("tool", tool.name());
         note.put("timesAsked", times);
+        JsonObject miss = misses.get(key(tool.name(), args, 
tool.deterministicWhen()));

Review Comment:
   💡 **Nit:** `key()` is computed three times in `repeatOf` when the count 
exceeds `FULL_ANSWERS` (for the `getOrDefault`, the `counts.merge`, and the 
miss lookup). Extracting a local variable makes it obvious all three use the 
same key — purely cosmetic.
   
   ```suggestion
           String repeatKey = key(tool.name(), args, tool.deterministicWhen());
           JsonObject miss = misses.get(repeatKey);
   ```



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