davsclaus opened a new pull request, #27654:
URL: https://github.com/apache/camel/pull/27654
## Summary
Shift+F8 ("fix with AI") writes a question for the AI panel that quoted only
the reported line. In the canonical YAML form that line is often just `- to:`,
with the endpoint on the lines below it, so the model did not see what failed.
The question now quotes the source around the line, as in a diff:
```
The source around it (> marks line 22):
20 | - expression: ...
21 | steps:
> 22 | - to:
23 | uri: direct
24 | parameters:
25 | name: aproval
26 | otherwise:
27 | steps:
```
- 2 lines of context before the line and after its step
- the whole step: the lines below that are indented deeper (YAML children,
chained Java calls, nested XML), at most 8, so a big block does not flood the
question
- the line is marked with `>`
- falls back to the single line when the file cannot be read
The chat showed a code block inside the quoted question as empty lines, as a
code block inside a blockquote is not rendered. The question is now quoted line
by line (hard breaks, so multi-line questions keep their line breaks) and a
code block in it is shown outside the quote.
Checked in a live session with a local model (qwen3.6 on Ollama): the
question renders with the excerpt and the model fixes the typo from it.
The Source Editor page describes the quoted source.
## Tests
- `AiFixPromptTest` (new): the excerpt of a canonical YAML step, the cap on
big steps, chained Java calls, blank/unknown rows, the question built from a
file, the fallback, and the chat rendering
- the existing `FixRuntimeFailureTest`, `SourceQuickFixTest`,
`LogErrorsTest` and `AiPanel*Test` pass
_Claude Code on behalf of davsclaus_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
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]