[
https://issues.apache.org/jira/browse/CAMEL-23704?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-23704.
---------------------------------
Fix Version/s: 4.21.0
Resolution: Fixed
> camel-ai - Use correlated exchange copy for multi-tool invocations in
> langchain4j-tools
> ---------------------------------------------------------------------------------------
>
> Key: CAMEL-23704
> URL: https://issues.apache.org/jira/browse/CAMEL-23704
> Project: Camel
> Issue Type: Improvement
> Components: camel-langchain4j-tools
> Reporter: Claus Ibsen
> Priority: Major
> Labels: help-wanted
> Fix For: 4.21.0
>
>
> Follow-up to CAMEL-21937.
> Currently, the LangChain4jToolsProducer.invokeTools() method reuses the same
> Exchange object across all tool invocations in a single LLM response.
> CAMEL-21937 fixed the most critical issue (ROUTE_STOP flag leaking between
> tools), but the shared exchange still allows:
> * Exchange body from one tool leaking to the next tool
> * Tool parameter headers accumulating across tool invocations
> * Exceptions from one tool affecting subsequent tools
> The proper fix is to create a correlated exchange copy (similar to how
> multicast/splitter work) for each tool invocation. Each tool route would
> execute on its own exchange, and the result would be collected from that
> exchange. This fully isolates tool executions and prevents any state leakage
> between tools.
> This also aligns with how other Camel EIPs handle similar fan-out patterns
> where multiple routes process the same exchange independently.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)