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

   https://issues.apache.org/jira/browse/CAMEL-25358
   
   ## Why
   
   In the inner loop a developer runs the app in dev mode, changes a route, and 
something fails: the Errors tab lists it, and the Source editor's live run data 
shows the failures on the line (✗N). *Shift+F8* (fix with AI) did nothing 
there, because it only acted on a problem from the editor's static checks.
   
   ## What
   
   - **Source editor and view:** *Shift+F8* on a line with failures in the live 
run data opens the AI panel with a question: how many exchanges failed on the 
line and the exception of the last one (read from the integration's error file 
when the key is pressed). The AI is asked to find the cause first, since it may 
lie elsewhere, such as a `direct:` endpoint no route consumes. A problem on the 
line still goes first. A file with unsaved edits has no runtime failures, 
because the live run data is of the saved file. *Shift+F8* now also works in 
the view, not only in edit mode, and the footer hint shows on failing lines.
   - **Lines that only count a failure** (the route's `from`, a `choice` around 
the failing processor) get the last error in the file, with its line.
   - **Errors tab:** *Shift+F8* on the selected error asks the AI with the 
source line of the processor it happened at (route and node mapped to 
file:line), and its exception.
   - New `RuntimeFailures` helper (error → source line, exception as one line); 
`AiFixPrompt.ofFailure`; `AskAi.fixFailure` as a default method, so existing 
lambdas keep working.
   - Docs: Source editor *Fix with AI* section and the Errors section of the 
observe page, with screenshots.
   
   ![Shift+F8 on a line that fails at 
runtime](https://github.com/apache/camel/raw/fix/CAMEL-25358/docs/user-manual/modules/ROOT/images/jbang/camel-tui-source-fix-runtime-failure.png)
   
   ![Shift+F8 on an error in the Errors 
tab](https://github.com/apache/camel/raw/fix/CAMEL-25358/docs/user-manual/modules/ROOT/images/jbang/camel-tui-errors-fix-with-ai.png)
   
   ## Tests
   
   - New `FixRuntimeFailureTest` (7 tests): the question, Shift+F8 in the view 
and in the editor, no question on a line without failures, none for an edited 
file, error → line mapping with the same-file fallback, and finding the file in 
the source directory.
   - Whole `camel-jbang-plugin-tui` module: 1732 tests pass.
   - Checked in the running TUI against an app with a `direct:` endpoint no 
route consumes; the screenshots are from that run.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01DDRLJAyf8cDXSg8iX785My


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