[
https://issues.apache.org/jira/browse/CAMEL-25358?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-25358.
---------------------------------
Resolution: Fixed
Merged in https://github.com/apache/camel/pull/27386 (commit 7514fbc164da) for
4.23.0.
> camel-jbang - source editor: Shift+F8 (fix with AI) on a line that fails at
> runtime
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-25358
> URL: https://issues.apache.org/jira/browse/CAMEL-25358
> Project: Camel
> Issue Type: Improvement
> Components: camel-jbang
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 4.23.0
>
>
> In the inner loop a developer runs the app in dev mode, changes a route, and
> something fails: the log shows an exception, the Errors tab lists it, and the
> source editor's heat map shows the failures on the line (✗N). Today
> *Shift+F8* (fix with AI) does nothing there: {{SourceViewer.askAiToFix()}}
> only acts on a line with an inline problem from the editor's static checks
> (schema, endpoint options, Simple). A runtime failure is not an inline
> problem, so the developer has to type the question into the AI panel
> themselves.
> Example (found while recording a demo with a local model): a route sends
> orders over 100 EUR to {{direct:big-orders}}, which no route consumes yet.
> After the reload those orders fail with
> {{DirectConsumerNotAvailableException}}, the line shows failures in the heat
> map, but Shift+F8 on it does nothing. (The static "direct: no route consumes"
> check is left out of the editor on purpose: it reads the whole project and
> the consumer is often written later; {{camel validate}} and the AI's
> {{camel_validate_source}} run it.)
> Proposal:
> * *Shift+F8* on a line whose processors failed at runtime (live data from the
> running integration, the error registry) opens the AI panel with a fix
> question, as {{AiFixPrompt}} does for an inline problem: the file and line,
> the exception class and message of the last failure on that line (and how
> many failed), and the line text.
> * An inline problem on the line keeps priority; the runtime failure is used
> when there is none.
> * The footer hint (Shift+F8 fix with AI) shows on such lines too, so the key
> is discoverable.
> * Works the same for YAML, XML and Java routes, and with /write live, so the
> AI's fix is typed in the editor and saved by the developer, and dev mode
> reloads it.
> This closes the loop the TUI is built for: run, see it fail, fix with AI,
> reload.
> _Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v8.20.10#820010)