davsclaus opened a new pull request, #28636:
URL: https://github.com/apache/camel/pull/28636

   https://issues.apache.org/jira/browse/CAMEL-26386
   
   Four findings from the local-model benchmark (r23), after the body type 
checks of CAMEL-25928 (#28500):
   
   - **A field read on the List of a JSON array file** (rest-code-first step 1, 
0 of 7 in r22 and r23): after `setBody resource:file:orders.json` and 
`unmarshal: json`, the model read `${body.orderId}`. The runtime hint came only 
after the first reload, so 4 runs that ended right still failed on the errors 
of their first version. The AI tools now read which JSON files of the project a 
`resource:` loads are arrays (`ProjectFacts.jsonArrays`), and the validator 
reports a Simple field read on that List at write time, with the jsonpath 
advice of the runtime hint. Groovy is left alone (`body.orderId` of a List is 
the List of the orderIds there).
   - **A field read after a marshal of a body that is not known** (enrich step 
3): in a `direct:` route a wire tap sends the order Map to, the advice 
"unmarshal: json is the step, not marshal" made the model unmarshal the Map, 
which failed at runtime. The advice now says first to read the field before the 
marshal.
   - **A `variableSend` of a header** (ai step 1): the model set a header 
`prompt` and sent `variableSend: prompt`, so the chat model got an empty 
request. This is reported when the route sets the header and nothing sets the 
variable (no bean, processor or script either).
   - **A setBody that emptied the body** (http-client step 1): the runtime hint 
for a null or empty body names the `setBody` or `transform` that emptied it, 
from the message history, instead of "read the data first".
   
   Tests: camel-yaml-dsl-validator (322), all camel-jbang-core AI tool tests 
(756), BodyFactsTest (11), green.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m


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