[
https://issues.apache.org/jira/browse/CAMEL-25363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18151134#comment-18151134
]
Claus Ibsen commented on CAMEL-25363:
-------------------------------------
Grouped for 4.25.0, as one theme: *a failure of an integration, why it
happened, and how to fix it*, in the CLI, the TUI and the MCP tools, with local
models too. The three tickets build on each other:
# CAMEL-26716 - *Good to know*: the shared rule set, with the outcome of each
rule (design PR #29554, section "Explaining a failure"). This is the "why"
without an AI.
# A shared failure model in camel-jbang-core: move {{RuntimeFailures}} (an
error to its source line), {{LogErrors}} (the ERRORs of a log, with their
Message History) and {{AiFixPrompt}} from the TUI plugin to {{commands/ai}}, as
was done for the authoring tools (CAMEL-24695). A refactoring with no change in
the TUI; done under CAMEL-25363.
# CAMEL-26821 - *explain a failure*: the Errors tab and the Timeline of the
TUI, {{camel get errors}} and the MCP tools, from the rules of CAMEL-26716, and
with an AI on Shift+F8.
# CAMEL-25363 - *camel fix*: the fix with AI from the plain CLI (diff, confirm,
validate, reload). {{camel fix --explain}} gives the explanation of
CAMEL-26821, so it is useful without an AI too; the {{ErrorDiagnoser}} the
description names is not in the repository.
Kept out of 4.24.0 on purpose: a command that edits files ships together with
the explanation it builds on.
_Claude Code on behalf of davsclaus (Claus Ibsen)_
> camel-jbang - camel fix: fix with AI from the command line
> ----------------------------------------------------------
>
> Key: CAMEL-25363
> URL: https://issues.apache.org/jira/browse/CAMEL-25363
> Project: Camel
> Issue Type: New Feature
> Components: camel-jbang
> Reporter: Claus Ibsen
> Priority: Major
> Fix For: 4.25.0
>
>
> CAMEL-25358 brought *Shift+F8* "fix with AI" to the Source editor, the Errors
> tab and the Log tab: something fails while the app runs in dev mode, and the
> AI gets a question with the source line, the exception and how often it
> failed. A {{camel fix}} command would give the same inner loop to people (and
> scripts) that use the plain CLI, next to {{camel ask}} and {{camel explain}}.
> Proposal:
> {noformat}
> camel fix # the newest distinct errors of the running
> app: pick one, fix its source line
> camel fix orders.camel.yaml:24 # fix what fails on that line
> camel fix --log # the latest ERROR in the log (the Message
> History gives the source line)
> camel fix --explain # no edits: explain only (ErrorDiagnoser
> when no AI provider is configured)
> {noformat}
> * Finds the running integration as {{camel ask}} does ({{--name}},
> auto-detected when one runs).
> * Writes the question as the TUI does ({{AiFixPrompt}}), and asks the model
> with the same providers and options as {{camel ask}} ({{--api-type}},
> {{--model}}, {{--url}}, Ollama auto-detected).
> * The change of the AI is shown as a diff and applied only when confirmed
> ({{--yes}} to skip); the file is validated, and dev mode reloads it.
> * Without an AI provider, {{--explain}} uses {{ErrorDiagnoser}} (the known
> causes and fixes of the exception), so it is useful offline too.
> To share the logic between the CLI, the TUI and the MCP tools, move
> {{RuntimeFailures}} (an error to its source line) and {{LogErrors}} (the
> ERRORs of a log, with their Message History) from the TUI plugin to
> {{camel-jbang-core}} ({{commands/ai}}), as was done for the shared authoring
> tools (CAMEL-24695).
> Related: CAMEL-25358 (Shift+F8 in the TUI), CAMEL-25362 (Shift+F8 in more TUI
> screens).
> _Claude Code on behalf of Claus Ibsen_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)