[
https://issues.apache.org/jira/browse/CAMEL-27244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Federico Mariani resolved CAMEL-27244.
--------------------------------------
Resolution: Later
> camel-spring-ai-chat - ask a person to confirm a tool call before it runs
> -------------------------------------------------------------------------
>
> Key: CAMEL-27244
> URL: https://issues.apache.org/jira/browse/CAMEL-27244
> Project: Camel
> Issue Type: New Feature
> Components: camel-spring-ai
> Reporter: Federico Mariani
> Assignee: Federico Mariani
> Priority: Major
>
> Spring AI 2.1.0 can pause the tool-calling loop before a tool runs ("tool
> call confirmation"). When the model calls a tool marked
> {{requiresConfirmation}}, no call of that reply runs, and the reply goes back
> to the application with the calls that wait for a decision. The application
> collects one {{ToolCallDecision}} per call (allow, or deny with a message),
> runs them with {{ToolCallingManager.executeToolCalls(prompt, reply,
> decisions)}} and sends the results to the model. The loop keeps nothing while
> it waits, so the decision can come much later and from another instance.
> For Camel this is a human-in-the-loop step before a tool that changes things
> (book, delete, pay): the approval can come from any route, such as a mail, a
> chat message, a REST call or a task list.
> h3. Proposal
> * A spring-ai-chat endpoint option naming the tools that need confirmation.
> It covers ai-tool routes, tool callbacks and MCP tools. The confirmation
> belongs to that endpoint: the same tool used by another endpoint or component
> runs as before.
> * When the loop pauses, the exchange ends with the pending calls (id, name,
> arguments) in a header, and a header that tells the reply waits for a
> decision.
> * Resume: a request with the same conversation id carries the decisions in a
> header. The allowed calls run, the denied ones answer the model with their
> message, and the loop continues.
> * The paused reply is read from the conversation memory, never from the
> request: session memory (CAMEL-27243) and chat memory. Spring AI's JDBC chat
> memory repository does not store tool calls, so session memory is the one for
> production.
> * A new message instead of a decision closes the pause: its calls are denied
> and do not run.
> Not in ai-tool for now: only spring-ai-chat can pause, so camel-openai,
> camel-langchain4j-agent and camel-mcp-server are unchanged.
> _Claude Code on behalf of Croway_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)