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

   https://issues.apache.org/jira/browse/CAMEL-26632
   
   Follow-ups from the r27 run of the local-model benchmark (qwen3.6, 7 
rounds). Tool names, arguments and their descriptions are unchanged. Two 
runtime messages change for every user: the Simple parser hint for text after a 
function (camel-core), and the Groovy messages for a class without its import 
(camel-groovy).
   
   **A ternary that picks a `resource:`** (transform-groovy step 3)
   - The ternary hint built its suggestion from the model's text, so a quoted 
`'resource:file:order.json'` stayed inside the function. A function's result is 
never loaded as a resource: the body became the text `resource:file:order.json` 
(JsonParseException). The hint now says "Write the whole ternary inside one 
function, and resource:file: before it: 
`resource:file:${exchangeProperty.CamelTimerCounter == 0 ? 'order.json' : 
'order-bad-email.json'}`". Checked on a running route: Simple resolves a 
`resource:` location with `${...}` per message.
   - A `resource:` that a function gives is refused at write time (accepted 5 
times in r25 to r27, and it failed every time). With `resolveResource: true` it 
is left alone.
   - `${body[CamelTimerCounter]}` says that CamelTimerCounter is an exchange 
property of the timer: `${exchangeProperty.CamelTimerCounter}`.
   
   **A header copied to itself** (connect-http-client step 2)
   - `setHeader` sku with `${header.sku}` in a split copies null when no step 
sets the header, and the HTTP call then had no SKU (98 errors). It is now 
reported: "${header.sku} is null here: no step before this line sets the header 
sku, so setHeader sku copies null to itself. In the split the body is one of 
the lines of the files in orders/ (price, qty, sku): write ${body[sku]}".
   - Only for routes from timer, scheduler, cron, quartz or file, when nothing 
before the line sets the header and a later step reads it.
   
   **A second condition under `otherwise:`** (connect-http-client step 3)
   - `otherwise:` written as a list with a condition item now gets "otherwise 
holds only steps:, the steps for a message that no when matches. A second 
condition is another item of when:, with its simple: and its steps: ...". This 
is in the YAML DSL validator, so `camel validate` shows it too.
   - The note "The YAML shape needs no change from you" was given while the 
repaired lines still had errors, and the model sent the same edit 16 times. 
When errors are left in the repaired lines, the note now says which lines still 
have errors.
   
   **`variableReceive` under `parameters:`** (connect-service-jms-request-reply 
step 2)
   - "jms: Unknown option 'variableReceive'" now adds "(variableReceive is a 
key of the to:, next to uri:, not an option of the jms endpoint: to: {uri: jms, 
parameters: {...}, variableReceive: stockReply})". The same for `pattern` and 
the other keys of the EIP, taken from the catalog, when the component has no 
option of that name.
   
   **A Groovy class without its import** (camel-groovy; 
connect-service-jms-request-reply step 3)
   - `new JsonSlurper()` without the import got "it is not on the classpath. 
Add the library that provides it as a dependency", and the model added a 
dependency and read the log 17 times. Now: "Groovy cannot resolve the class 
JsonSlurper: it is groovy.json.JsonSlurper, which the script does not import. 
Add import groovy.json.JsonSlurper at the top of the script, or write new 
groovy.json.JsonSlurper()."
   - A class that is really missing keeps the old message. A static use without 
the import (`JsonOutput.toJson(body)`) gets the same hint, in place of the list 
of script variables.
   
   **Text after a Simple function** (camel-core; contracts-rest-code-first 
steps 1 and 2)
   - `${body.lines}.size() > 0` got "operators and values must be separated by 
a space" (18 calls of the expression tool in one step). The parser hint now 
says "the method .size() is outside the function, as text after its closing 
brace: write it inside the braces, ${body.lines.size()}". Other text keeps its 
message.
   - At write time, a filter written right after a function 
(`${body}?.?[orderId == '${header.id}']`) gets the message of a filter inside 
one, with the jsonpath step to write. An unknown function with a nested one 
(`${size:${body}}`), which passed and then failed when the route ran, is now 
reported. A name followed by `(` is left alone, as it can call a custom 
function.
   
   **Checks**
   - The validator gives the same messages as before on the 59 bundled 
examples, the 89 files of the r27 reference passes, and the 2,954 final files 
of the passed steps of r23 to r27.
   - Tests pass: the `ai` package of camel-jbang-core (939, 1 skipped: a test 
that downloads), the Simple tests of camel-core (735), camel-groovy (135), 
camel-yaml-dsl-validator (350).
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_016Y4dDi5iQNgtHrDdz2NpwF
   


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