oscerd commented on PR #27264:
URL: https://github.com/apache/camel/pull/27264#issuecomment-5978569815

   Thanks @davsclaus — all three addressed, plus the optional notes:
   
   - **`AiToolExecutor.execute()` javadoc** — updated. It no longer says the 
adapter creates and releases the exchange; it now says the adapter obtains the 
exchange from `createToolExchange(...)`, which is not a pooled consumer 
exchange, so there is no `releaseExchange()` to call.
   - **`@param callingExchange` on `McpToolCallExecutor.execute`** — added 
(thanks @gnodet-bot for re-raising).
   - **Shared exchange id** — fixed rather than only documented. Building on 
@allthingssecurity's thread, `createToolExchange` now gives the tool exchange 
its **own** unit of work and its **own** id (`callingExchange.copy()` + 
`getExchangeExtension().setUnitOfWork(null)`). So parallel tool calls no longer 
share the caller's id, the tool route's own `onCompletion`/error handler apply 
to the tool call, and an error handler's `useOriginalMessage()` can no longer 
restore the caller's message into the result (that last one otherwise quietly 
undid the clean message). New regression test 
`createToolExchangeGivesTheToolRouteItsOwnUnitOfWork` pins it; the "The calling 
exchange" doc section and the 4.23 upgrade guide now describe the 
own-unit-of-work behaviour (for langchain4j it is part of the documented 
behaviour change).
   
   On the optional spring-ai-chat / langchain4j-agent wiring tests: the shared 
helper is pinned by the camel-ai-tool tests and the openai wiring test 
exercises the end-to-end path, so a drift back to a fresh exchange in the 
shared helper is caught. I'm happy to add per-runtime wiring tests for 
spring-ai and langchain4j too — say the word and I'll put them in this PR 
rather than a follow-up.
   
   _Claude Code on behalf of oscerd_
   


-- 
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]

Reply via email to