davsclaus opened a new pull request, #29613:
URL: https://github.com/apache/camel/pull/29613
A follow-up to CAMEL-26758 (the loop breaker), from r31 of the local-model
benchmark (qwen3.6, 7 rounds). In r31 the loop breaker fired twice, and both
steps passed. One loop was left: contracts-rest-code-first step 1 sent the same
file 13 times and failed. The file had two problems. The refusal of the
jsonpath with `[]` gave the line to write. The refusal of `constant:` with
`${header.id}` said "use simple: {expression: ...}", but gave no lines to
write. The loop breaker writes only when every problem is fixed, so it could
not act.
**What changes**
- The refusal of a constant that holds a simple function now ends with the
lines to write: `Write line 7 as:`, or `Write lines 57-58 as:` when the value
is on the lines below the key, and the lines with `simple:` in place of
`constant:`. The indentation and the dash of a list item are kept. For a value
of more than 12 lines, only the line of the key is given.
- A model can copy the lines, and on the third identical write the loop
breaker applies them like the other fixes.
- The lines are added in the write tool's checks (`SourceValidator`), next
to `IndentLines` (CAMEL-25556). The message of the YAML validator itself is
unchanged.
**Tests**
- New `ConstantLinesTest`: a constant on its line, a value on the lines
below the key, the short form of a header, a list item, a long value, and lines
that are not a constant.
- `AuthoringToolsRefusalFixesTest`: the r31 case, with the `[]` and the
constant in one file, is written on the third identical write with both fixes.
- The real file of that r31 run (its 18th write, with the example's project
files) is now written on the third send, with both fixes.
- Run locally: the camel-jbang-core `ai` package, 1015 tests, 0 failures, 1
skipped.
🤖 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]