Claus Ibsen created CAMEL-25744:
-----------------------------------

             Summary: camel-jbang - the AI validator reports a comparison of 
CamelTimerCounter that can never be true, as the counter starts at 1
                 Key: CAMEL-25744
                 URL: https://issues.apache.org/jira/browse/CAMEL-25744
             Project: Camel
          Issue Type: Improvement
          Components: camel-jbang
            Reporter: Claus Ibsen
             Fix For: 4.24.0


In the overnight benchmark of Oct 17-18 2026 (ten runs of a local model on the 
example ladder), the hardest step asks for a timer that fires twice and picks a 
file on the first fire with {{CamelTimerCounter}}. In 8 of the 10 runs the 
model compared the counter with 0. The counter counts the fires from 1 
({{TimerConsumer}} uses {{incrementAndGet()}}), so {{== 0}} is never true, and 
both fires took the second file. The option description says so since 
CAMEL-25530, but the model looked it up in only 2 of the runs, and 
{{camel_validate_source}} accepted the route.

Proposal: the validator reports a comparison of {{CamelTimerCounter}} that can 
never be true ({{== 0}}, {{<= 0}}, {{< 1}}) or never be false ({{!= 0}}), in 
Simple and in Groovy, with a hint to compare with 1 for the first fire.

Note: reading the counter as {{$\{header.CamelTimerCounter\}}} works, because a 
header lookup in Simple falls back to the exchange properties; the validator 
already accepts it when {{includeMetadata}} is true.

_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to