Skip to content

Remove streamToolCallResponses from advisor builders#6391

Closed
tzolov wants to merge 1 commit into
spring-projects:mainfrom
tzolov:remove-stream-tool-call-responses
Closed

Remove streamToolCallResponses from advisor builders#6391
tzolov wants to merge 1 commit into
spring-projects:mainfrom
tzolov:remove-stream-tool-call-responses

Conversation

@tzolov

@tzolov tzolov commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

When streamToolCallResponses=true, tool-call request chunks were streamed downstream without the paired ToolResponseMessage, corrupting any downstream memory advisor's conversation history. The flaw cannot be fixed cleanly, so the option is removed from ToolCallingAdvisor, ToolCallAdvisor, and ToolSearchToolCallingAdvisor builders along with the corresponding auto-configuration properties.
Two replacement patterns are documented:

  • Placing a custom advisor inside the tool-call loop (order > `ToolCallingAdvisor.DEFAULT_ORDER) to observe every iteration via a side channel
  • Disabling the auto-registered advisor with AdvisorParams.toolCallingAdvisorAutoRegister(false) and driving the loop manually.
    Integration tests for the manual pattern are added . Upgrade notes for 2.0.0 GA cover impact and migration steps.

@tzolov tzolov added this to the 2.0.0 milestone Jun 11, 2026
@tzolov tzolov force-pushed the remove-stream-tool-call-responses branch from 4002040 to cede45c Compare June 11, 2026 09:34
When streamToolCallResponses=true, tool-call request chunks were
streamed downstream without the paired ToolResponseMessage, corrupting
any downstream memory advisor's conversation history.
The flaw cannot be fixed cleanly, so the option is removed from
ToolCallingAdvisor, ToolCallAdvisor, and ToolSearchToolCallingAdvisor
builders along with the corresponding auto-configuration properties.

Two replacement patterns are documented:
- Placing a custom advisor inside the tool-call loop
  (order > `ToolCallingAdvisor.DEFAULT_ORDER) to observe every iteration
  via a side channel
- Disabling the auto-registered advisor with
  AdvisorParams.toolCallingAdvisorAutoRegister(false) and driving the
  loop manually.

Integration tests for the manual pattern are added .
Upgrade notes for 2.0.0 GA cover impact and migration steps.

Fix AbstractToolSearchToolCallingAdvisorIT

Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
@tzolov tzolov force-pushed the remove-stream-tool-call-responses branch from cede45c to 085efd3 Compare June 11, 2026 09:37
@ilayaperumalg

Copy link
Copy Markdown
Member

The module spring-ai-tool-search-advisor needs lucene-core as a test dependency. Also, the test AbstractToolSearchToolCallingAdvisorIT requires changes to enable the Chat memory inside the tool call advisor loop. Will fix them when merging.

@ilayaperumalg

Copy link
Copy Markdown
Member

Rebased, merged along with the test fixes via a753fde

@sdeleuze sdeleuze changed the title Remove streamToolCallResponses from advisor builders Remove streamToolCallResponses from advisor builders Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants