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

   [CAMEL-25676](https://issues.apache.org/jira/browse/CAMEL-25676)
   
   `camel ask` runs the shared AI tools of camel-jbang-core against a running 
integration, with a local or a hosted model. It asked before nothing, and it 
sent every tool to every model.
   
   ### Confirmations
   `camel ask` now follows the developer tools section of the security model. 
It asks on the terminal before:
   
   - **a file write**, with the change as a diff (`ToolConfirms.write`). 
`ToolContext` has a confirmer that the shared write tools ask: `camel ask` sets 
it, and the MCP server leaves it unset. `write_file` is gone: 
`camel_write_file` and `camel_edit_file` cover it, with validation. A write to 
a directory other than the project's shows the full path.
   - **a message** to an endpoint the integration does not have, or with a body 
read from a file outside the project;
   - **SQL** other than a single SELECT, SHOW or DESCRIBE;
   - **an expression** in a language that runs code;
   - **stopping, killing or restarting** the integration or its routes, running 
an integration, browsing an endpoint the integration does not have, and a heap 
dump;
   - **a camel command** that changes something. `get`, `ps`, `catalog`, `doc` 
and the reading subcommands of `version`, `infra`, `config`, `dependency` and 
`plugin` run without asking.
   
   Without a terminal to ask on, such a call does not run unless `--yes` is 
passed. A call the user does not confirm does not run, and the model is told so.
   
   The rules (`ToolConfirms`) move to camel-jbang-core, next to the shared 
tools, so every client of the tools uses the same ones. The correction request 
for an answer with an invalid simple expression moves to `AnswerChecks` for the 
same reason.
   
   ### Tools that fit the model
   - **Local providers** get the core tools and the tool groups of the selected 
integration (SQL, tracing, resilience, HTTP, under the shared names):
     - the core `camel_*` tools;
     - the runtime tools now flagged core: context, routes, health, endpoints, 
properties, history, topology, processor detail, processes, send;
     - `cli_exec`.
   - **Hosted providers** get the full set, without the tools the `camel_*` 
tools replaced (`get_errors`, `eval_expression`, the `catalog_*` tools).
   - **`--tools=auto|core|full`** chooses; `auto` is the default.
   - **The system prompt** uses the new shared `AuthoringGuidelines`: YAML step 
shapes, Simple operators, the edit loop, and reading the log to tell what 
happened to messages. It says which calls ask first, and no longer names a 
`stop_route` tool that does not exist.
   - **`--max-iterations`** is 25 instead of 10.
   - **An answer with an invalid simple expression** gets one correction.
   - **`--model llama3.2`** is now used as named. Without `--model`, Ollama 
keeps using the installed model best at tool calling.
   - **A model under 8B parameters** gets a note: in a test, llama3.2 (3B) got 
three of four questions about a running integration wrong.
   
   ### Measured
   Oct 15, qwen3.6:35b-mlx on Ollama, four questions about the running 
`fail-well/error-handling` example. The first request of a question was 9.5k 
tokens with all 74 tools, against 5.2k with the core tool set. The four 
questions took 89 s against 68 s, and 145k tokens against 122k (numbers in the 
Jira).
   
   ### Tests and docs
   - `ToolConfirmsTest` (moved, with the new rules), `AskToolsTest` and 
`AskTest`: tool sets, refused and confirmed calls end to end (a write in a temp 
directory), the terminal prompt, no terminal, `--yes`, the small-model note.
   - `mvn verify` of camel-jbang-core (1891 tests) and of the plugin that uses 
the confirmation rules (2141 tests) pass; the plugin's source size limits take 
the one import line of `CamelMonitor` and the shorter `AiPanel`.
   - Docs: the `camel ask` page ("What asks first", "Local and hosted models"), 
the security model and the 4.24 upgrade guide.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   
   https://claude.ai/code/session_01STT6whBgK1AqsSsUKrnE8m
   


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