Skip to content

fix(fm): remove synthesized finish tool call from stream path#9

Closed
subpop wants to merge 1 commit intoTom-Ryder:mainfrom
subpop:remove-synthesized-finish-tool
Closed

fix(fm): remove synthesized finish tool call from stream path#9
subpop wants to merge 1 commit intoTom-Ryder:mainfrom
subpop:remove-synthesized-finish-tool

Conversation

@subpop
Copy link
Copy Markdown
Contributor

@subpop subpop commented Apr 5, 2026

FoundationModelsClient.stream() was emitting a synthetic 'finish' tool call after streaming completed. This caused Chat to try executing it as a real tool, fail with 'Tool finish does not exist', and loop. The content is already streamed via .content() deltas so the synthetic finish is unnecessary. The generate() path retains it for the Agent class which expects it.

FoundationModelsClient.stream() was emitting a synthetic 'finish' tool
call after streaming completed. This caused Chat to try
executing it as a real tool, fail with 'Tool finish does not exist', and
loop. The content is already streamed via .content() deltas so the
synthetic finish is unnecessary. The generate() path retains it for the
Agent class which expects it.
@Tom-Ryder
Copy link
Copy Markdown
Owner

Thanks for opening this and tracking down the FM streaming issue. I ended up landing a broader fix on main because the stream-only change would also have affected Agent.stream(): cc2422f

Really appreciate the PR and the investigation.

@subpop
Copy link
Copy Markdown
Contributor Author

subpop commented Apr 5, 2026

Thanks for opening this and tracking down the FM streaming issue. I ended up landing a broader fix on main because the stream-only change would also have affected Agent.stream(): cc2422f

Really appreciate the PR and the investigation.

Ah okay. I wasn't sure if it was a Chat-only bug. I did a little digging, but didn't dig deep enough it seems.

@subpop subpop closed this Apr 5, 2026
@subpop subpop deleted the remove-synthesized-finish-tool branch April 5, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants