davsclaus opened a new pull request, #27330: URL: https://github.com/apache/camel/pull/27330
[CAMEL-25307](https://issues.apache.org/jira/browse/CAMEL-25307). **Stacked on #27318 (CAMEL-24834)**: the base branch is `fix/CAMEL-24834`, so this shows only the HTTP group. It moves to main when #27318 is merged. A fourth tool group for local models: when the selected integration serves HTTP, it gets two tools to see what it serves and to call itself. ### What changes - **`camel_runtime_http_endpoints`** (read-only) returns: - the served operations: method, path, route id, and Rest DSL or platform-http; - the server's port and base path, and the contract name; - with `includeSpec`, the loaded OpenAPI contract, capped at 12,000 characters. - It reads `platform-http` and `rests` from the status file. `main-http-server` is not in the status, so the port comes from the platform-http server. - **`camel_runtime_http_request`** (method, path, headers, body) calls **the integration's own server only**: - A path always goes to `http://localhost:<port>`. A full URL is accepted only for localhost on that port; anything else is refused. - Redirects are not followed. The answer shows the status and `Location` instead. - Timeout 30 s (max 120 s). The body is capped at 6,000 characters, and the answer says when it was cut. - It is a development tool, like the SQL tool of #27318, so POST and the other methods are allowed. - **The group loads** on platform-http, rest or rest-openapi consumer endpoints, or a `rest: openApi:` contract. Guidance line: "HTTP: served on http://localhost:8080/api (contract stock-api.json); camel_runtime_http_request calls it, camel_runtime_http_endpoints lists the operations." - **The fingerprint** now ends in the base URL when HTTP is served. - **AI panel of the camel-jbang views:** `tui_http_endpoints` and `tui_http_request` delegate to the shared tools. They are loaded by the group, not part of the core set. - **Prompt budget:** - core + all four groups: about 5,460 tokens, budget raised from 5,500 to 5,750; - full set: about 10,073 tokens, budget raised from 9,850 to 10,250. - The two tools cost about 245 tokens and the guidance line about 35. The comments say why. - **Docs:** camel-jbang-mcp (both tools, the http row in the tool groups) and TUI local models. ### Tests - New `HttpEndpointsTest`, including real requests against a JDK HttpServer: - a POST with a header and a body - a body cut at 6,000 characters - a 302 that is not followed - another host refused - Extended `AppFeaturesTest`, `ToolGroupsTest`, `ToolRegistryTest`, `RuntimeToolsTest`, `AiPanelToolGroupsTest`, `AiPanelPromptBudgetTest`. - Module suites: camel-jbang-core 1476, camel-jbang-mcp 430, camel-jbang-plugin-tui 1725, all pass. - Live through the MCP server against the stock-api example: - the group and guidance load; - both operations are listed; - `GET /stock/CAMEL-SOCKS` returns the real 404 with its JSON body; - `http://example.com/` is refused. ### Local-model benchmark qwen3.6 35b-a3b, 64k context, the four HTTP examples, 5 runs each, same jar. | Series | Strict | Final state right | |---|---|---| | without groups | 51/65 | 56/65 | | with groups, run 1 | 54/65 | 59/65 | | with groups, clean rerun | 50/65 | 55/65 | - **Use:** the model calls the request tool a lot (94 and 98 calls per series). - **Score:** five runs vary by about 4 steps, so there is **no measurable score gain** yet. - **What still fails:** - openapi-client sends a Map body to a JSON operation (CAMEL-25309, separate PR); - an empty path parameter is sent as a literal `{sku}`. - Neither is something the HTTP tools can fix. - **Scoring:** "final state right" leaves out errors the model caused while testing its own app with the request tool. The strict score counts those against it. 🤖 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]
