Skip to content

CAMEL-23397: Support route tool annotations (returnDirect) in camel-o… - #26134

Draft
mcarlett wants to merge 1 commit into
apache:camel-4.22.xfrom
mcarlett:backport/CAMEL-23397-to-camel-4.22.x
Draft

CAMEL-23397: Support route tool annotations (returnDirect) in camel-o…#26134
mcarlett wants to merge 1 commit into
apache:camel-4.22.xfrom
mcarlett:backport/CAMEL-23397-to-camel-4.22.x

Conversation

@mcarlett

@mcarlett mcarlett commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

…penai agentic loop

Adds parity between MCP tools and route-based ai-tool tools in the camel-openai agentic loop. camel-ai-tool gains a returnDirect annotation/configuration field (with a 5-arg compatibility constructor preserving 4.22.0 binary compatibility), camel-mcp-server publishes it via VertxMcpServerEngine, and camel-openai adds a new tags endpoint option to discover route tools from the shared AiToolRegistry, execute them through AiToolExecutor, and honour returnDirect to short-circuit the agentic loop. Route tools are refreshed dynamically as the registry changes, and manual tool-execution loops support tags-only route tools.

Closes #25497

(cherry picked from commit 2c3b65a)

…penai agentic loop

Adds parity between MCP tools and route-based ai-tool tools in the camel-openai
agentic loop. camel-ai-tool gains a returnDirect annotation/configuration field
(with a 5-arg compatibility constructor preserving 4.22.0 binary compatibility),
camel-mcp-server publishes it via VertxMcpServerEngine, and camel-openai adds a
new `tags` endpoint option to discover route tools from the shared AiToolRegistry,
execute them through AiToolExecutor, and honour returnDirect to short-circuit the
agentic loop. Route tools are refreshed dynamically as the registry changes, and
manual tool-execution loops support tags-only route tools.

Closes apache#25497

Co-authored-by: Omar Atie <atiaomar1978-hub@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit 2c3b65a)
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 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 have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • catalog/camel-catalog
  • components/camel-ai/camel-ai-tool
  • components/camel-ai/camel-mcp-server
  • components/camel-ai/camel-openai
  • dsl/camel-componentdsl
  • dsl/camel-endpointdsl

🔬 Scalpel shadow comparison — Scalpel: 17 tested, 26 compile-only — current: 14 all tested

Maveniverse Scalpel detected 43 affected modules (current approach: 14).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 17 modules (6 direct + 11 downstream), skip tests for 26 (generated code, meta-modules)

Modules Scalpel would test (17)
  • camel-ai-tool
  • camel-catalog
  • camel-componentdsl
  • camel-endpointdsl
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-langchain4j-agent
  • camel-launcher-container
  • camel-mcp-server
  • camel-mcp-server-api
  • camel-openai
  • camel-spring-ai-chat
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
Modules with tests skipped (26)
  • apache-camel
  • camel-allcomponents
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-csimple-maven-plugin
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • components/camel-ai/camel-mcp-server: 1 test(s) disabled on GitHub Actions
  • components/camel-ai/camel-openai: 7 test(s) disabled on GitHub Actions
All tested modules (43 modules)
  • Camel :: AI :: LangChain4j :: Agent
  • Camel :: AI :: MCP Server
  • Camel :: AI :: MCP Server API
  • Camel :: AI :: OpenAI
  • Camel :: AI :: Tool
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: Spring AI :: Chat
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants