davsclaus opened a new pull request, #29410: URL: https://github.com/apache/camel/pull/29410
https://issues.apache.org/jira/browse/CAMEL-26730 Follow-ups from the r29 run of the local-model benchmark (qwen3.6, 5 rounds). **A literal `\n` between a value and the next key** In contracts-rest-code-first step 1 the model wrote the two characters `\n` after a value where it meant a line break: ```yaml expression: "$[?(@.orderId == '${header.id}')]"\n resultType: java.util.List ``` The validator said so and gave the two lines to write, but the model sent the same file again 15, 10 and 16 times in three runs (and 15 times in r28), until its tool calls ran out. It copies the `\n` from the JSON text of an earlier answer. - The write tool, and `camel_edit_file` which writes through it, now writes such a `\n` as a line break by itself. It uses the validator's lines only when they are the old line with each `\n` turned into a line break, and only when each new line starts in a column that a key or item above has; the write goes ahead only when the result validates. - The answer says what was repaired: "Written with these repairs of the YAML (the file has them now): lines 45-46: the two characters \n after the value of expression written as a line break." - Left alone: a `\n` inside quotes, block scalars, Groovy and Simple code, plain text such as `Hello\nWorld`. - The validator gives the same "followed by \n" message for a plain value in that position (it said "holds a colon, quote it"); real text with a colon is still told to quote it. **A file named as the body of a Citrus http action** The Citrus test refusal of CAMEL-26690 (#29323) gives the http actions to write. In test-citrus-orders step 1 (r29n-4) the model wrote `body: classpath:test/sample-order.json`, and the suggestion put it under `data:`, so the test sent that text instead of the file. - A body that names a file now goes under `body: {resource: {file: ...}}`, the Citrus 5.1.0 form for it. A `classpath:` or `file:` value is kept as written; a file of the project is named from the test (`sample-order.json` becomes `../sample-order.json`). Other text stays under `data:`. - The suggested lines are still given only when they pass the schema. **Checks** - The 56 refused writes of r28 and r29 with the literal `\n` are now all written (none before), and each written file validates. - The answers are identical, with no repair, for the final files of 3,902 passed steps of r23 to r29, 120 reference files and the 59 bundled examples. - All 52 writes and edits of the Citrus test in steps 1 and 2 of r26, r28 and r29 get the same answers as before, except 3 suggestions that now use `resource:` (r26n-3 had the same problem). - Tests pass: camel-yaml-dsl-validator, and the `ai` package of camel-jbang-core. 🤖 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]
