This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch fix/CAMEL-24760 in repository https://gitbox.apache.org/repos/asf/camel.git
commit 6161dbc764fe091db68cff7df76f825556120303 Author: Claus Ibsen <[email protected]> AuthorDate: Tue Sep 15 23:27:17 2026 +0200 CAMEL-24760: camel-jbang - tui_get_diagram, tui_filter and tui_set_log_level leave the core tool set for local models A tool earns its place in the core set by the questions a local model gets asked, not by its size: the topology JSON answers how routes relate (the ASCII drawing is for the screen), the whole table comes back without a filter, and the root log level is a rare request. About 620 characters less in every request; the prompt line on the log level moves to the full set where the tool is. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj --- .../java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java | 4 ++-- .../apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java index 50364f7fb45a..9d5b1b6f831b 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/AiPanel.java @@ -2901,8 +2901,8 @@ class AiPanel { sb.append("- Write files only with camel_write_file; never paste file contents in the answer\n"); sb.append("- YAML DSL shape: a step is `- log: {message: ...}`, `- to: {uri: ...}`, an expression goes under "); sb.append("expression: (`- setBody: {expression: {simple: ...}}`); the shorthand forms are deprecated\n"); - sb.append("- tui_set_log_level is the app's root logger, only when asked; 'log at WARN' in a route is the log "); - sb.append("step's loggingLevel in the source\n"); + sb.append("- 'log at WARN' in a route is the log step's loggingLevel in the source"); + sb.append(useCoreTools() ? "\n" : "; tui_set_log_level is the app's root logger, only when asked\n"); sb.append("- Simple: functions inside ${...}, operators between them: ${header.a} == 'b', "); sb.append("${body} ?: 'none'; camel_eval_expression checks one, camel_catalog_doc simple lists them\n"); if (!useCoreTools()) { diff --git a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java index 035a8b03a6b7..ea7f8f695cbd 100644 --- a/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java +++ b/dsl/camel-jbang/camel-jbang-plugin-tui/src/main/java/org/apache/camel/dsl/jbang/core/commands/tui/TuiToolRegistry.java @@ -157,10 +157,13 @@ class TuiToolRegistry { static final String VALIDATE_TOOL = "camel_validate_source"; /** The TUI's own tools in the core subset; the shared tools add those flagged core in the registry. */ + // CAMEL-24760: a tool earns its place here by the questions a local model gets asked, not by its size. + // tui_get_diagram is the ASCII drawing of what tui_get_topology returns as JSON, tui_filter a screen nicety + // (tui_get_table returns the whole table), tui_set_log_level a rare request the prompt guards anyway. private static final Set<String> CORE_TUI_TOOLS = Set.of( - "tui_get_state", "tui_get_options", "tui_get_table", "tui_get_diagram", "tui_get_topology", + "tui_get_state", "tui_get_options", "tui_get_table", "tui_get_topology", "tui_get_processor_detail", "tui_get_history", "tui_get_spans", "tui_send_message", - "tui_get_readme", "tui_navigate", "tui_set_log_level", "tui_filter", "tui_get_status", "tui_infra"); + "tui_get_readme", "tui_navigate", "tui_get_status", "tui_infra"); static final Set<String> CORE_TOOLS = Stream.concat( CORE_TUI_TOOLS.stream(),
