davsclaus opened a new pull request, #26753: URL: https://github.com/apache/camel/pull/26753
Fixes https://issues.apache.org/jira/browse/CAMEL-24907 (part of CAMEL-24886) `camel_eval_expression` evaluates in the running integration when one is selected, and in a local scratch context otherwise. In that local context only the languages on the server's own classpath worked; everything else answered ```json {"language":"jsonpath","status":"error", "error":"Unknown language 'jsonpath': ... the jsonpath language is in camel-jsonpath; add camel-jsonpath to the classpath"} ``` which is accurate and useless to a model: it cannot add anything to that classpath. So the one tool that could check a filter **before** it is written refused exactly when it would help. In the stepwise benchmark the HTTP examples filter with `$[?(@.sku == '${header.sku}')]` in every example, the model called the evaluator 23 times across three series, and never once checked a jsonpath before writing it. - The language's component is downloaded the way `camel run` downloads what a route needs (`MavenDependencyDownloader` into a `DependencyDownloaderClassLoader`), the class loader is kept per coordinates so the next call does not download again, and the answer names the artifact in `downloaded`. - The class loader is set on the context **before** it starts, which is what makes the language resolvable. - A failing expression now also carries the catalog's own check, `validateLanguageExpression` / `validateLanguagePredicate` with that class loader, as `syntaxError` and `syntaxErrorAt`, so the answer says where the text breaks rather than only what the evaluation threw. - When there is nothing to download, or no network, the error says to select a running integration that has the language instead. Tests: `ExpressionEvaluatorLanguageTest` (an unknown language says what to do, this process's languages are unchanged, a broken simple expression carries the syntax error, and a jsonpath download-and-evaluate behind `-Dcamel.test.download=true`, verified locally). 245 ai tests, 410 MCP tests, the prompt budget unchanged. Documented in the MCP tool table and the upgrade guide. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Bp3538HRBPMQkb5ta9xRaj -- 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]
