You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "davsclaus (via GitHub)" <gi...@apache.org> on 2026/10/15 09:38:06 UTC

[PR] CAMEL-25676: camel-jbang - camel ask confirms risky tool calls and fits the tools to the model [camel]

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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25676: camel-jbang - camel ask confirms risky tool calls and fits the tools to the model [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27887:
URL: https://github.com/apache/camel/pull/27887#issuecomment-6189163850

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25676: camel-jbang - camel ask confirms risky tool calls and fits the tools to the model [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27887:
URL: https://github.com/apache/camel/pull/27887


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25676: camel-jbang - camel ask confirms risky tool calls and fits the tools to the model [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27887:
URL: https://github.com/apache/camel/pull/27887#issuecomment-6190547481

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `docs`
   - `dsl/camel-jbang/camel-jbang-core`
   - `dsl/camel-jbang/camel-jbang-plugin-tui`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 5 of 704 tested, 8 compile-only — current: 5 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **5 affected modules** (current approach: 5).
   
   **Skip-tests mode would test 5 modules** (3 direct + 4 downstream), **skip tests for 8** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (5)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/CamelMonitor.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/Confirmations.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/McpFacade.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ToolConfirmPopup.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/ToolConfirms.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/McpFacadeConfirmTest.java, dsl/camel-jbang/came
 l-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/SourceSizeTest.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ToolConfirmPopupTest.java, dsl/camel-jbang/camel-jbang-plugin-tui/src/test/java/org/apache/camel/dsl/jbang/core/commands/tui/ToolConfirmsTest.java
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   
   </details>
   
   <details><summary>Modules with tests skipped (8)</summary>
   
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (15 modules, 3m 19s total)</summary>
   
   **Total reactor time:** 3m 19s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 51.1s | SUCCESS |
   | Camel :: JBang :: MCP | 44.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 38.0s | SUCCESS |
   | Camel :: Docs | 21.5s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 17.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 15.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 2.7s | SUCCESS |
   | Camel :: Coverage | 1.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.6s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 1.6s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.3s | SUCCESS |
   | Camel :: JBang :: Main | 0.9s | SUCCESS |
   | Camel :: Launcher :: Container | 0.8s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (51.1s)
   - `Camel :: JBang :: MCP` (44.4s)
   - `Camel :: JBang :: Plugin :: Validate` (38.0s)
   - `Camel :: Docs` (21.5s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (17.8s)
   - `Camel :: JBang :: Plugin :: Testing` (15.7s)
   - `Camel :: JBang :: Plugin :: MCP` (2.7s)
   - `Camel :: Coverage` (1.8s)
   - `Camel :: JBang :: Plugin :: Edit` (1.6s)
   - `Camel :: JBang :: Plugin :: Generate` (1.6s)
   - `Camel :: JBang :: Integration tests` (1.3s)
   - `Camel :: JBang :: Main` (0.9s)
   - `Camel :: Launcher :: Container` (0.8s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/38714385028)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org