Claus Ibsen created CAMEL-26568:
-----------------------------------

             Summary: camel-jbang - AI tools and messages: a JMS reply that 
replaces the message, file as a language, ${file:noext}, parseText on bytes, 
and an unused placeholder
                 Key: CAMEL-26568
                 URL: https://issues.apache.org/jira/browse/CAMEL-26568
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang, camel-yaml-dsl, camel-groovy, camel-core
            Reporter: Claus Ibsen
             Fix For: 4.24.0


Fixes from the r26 run of the local-model benchmark (qwen3.6, 7 rounds), for 
the messages the AI tools and Camel give.

*A JMS reply that replaces the message (jms request-reply, step 2: 1 of 7 runs 
passed)*
After a to: on jms, sjms, sjms2, activemq, activemq6 or amqp sent InOut, the 
body is the reply, and the message that was sent is gone. The models logged the 
reply and lost the order. The write answer now has a note on that line: add 
variableReceive to the to: and read the reply as ${variable.<name>}. There is 
no note when the to: has variableReceive, or when a later step sets the body. 
Checked on the benchmark traces: the note is on the writes of all 6 failed 
runs, and on none of the 2,425 final files of passed steps.

*${file:noext} (sftp, step 3: 3 of 7)*
"Unknown file language syntax: noext" listed four file functions and said that 
they do not read a file. It now says "did you mean ${file:name.noext}?" (also 
for name:noext, a different case or a typo), and keeps the advice about reading 
a file for a path. This is the Simple error in camel-core-languages, so every 
user gets it. The AI tools also check Simple in the file options of file, ftp, 
ftps, sftp and smb endpoints (fileName, move, moveFailed, ...) at write time: 
fileName: ${file:noext}.txt in a to: sftp was accepted before and failed only 
at reload.

*file as a language (jms, step 3: 5 of 7 runs wrote expression: file:)*
The refusal said only "property 'file' is not defined". It now says that file 
is not a language, and shows constant: with "resource:file:stock.json".

*parseText on bytes (jms, step 3)*
new JsonSlurper().parseText(body) on a byte[] body fails with a 
MissingMethodException. camel-groovy now adds a hint to that error: parse the 
bytes with new JsonSlurper().parse(body), or unmarshal them first.

*An unused placeholder (nightly report, step 4)*
The note from CAMEL-26482 was right in all 3 failed runs, but the models only 
repeated it. The answer of the write now starts with what to do: use the 
placeholder again, and set the value in application.properties.

*Two smaller ones*
* The "did you mean ${exchangeProperty.x}" advice (CAMEL-26483) pointed to a 
variable when a Groovy script set the exchange property. It now names the 
property.
* The schema hint listed choice among the EIPs that have steps:. Choice now 
gets its own hint: steps go under a when: or under otherwise:.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to