Skip to content

Conversation

@longfin
Copy link
Contributor

@longfin longfin commented Sep 5, 2025

When generateHelper recursively calls itself during tool iterations, the abortSignal was not being passed to the recursive call. This caused abort signals to be lost after the first tool iteration, preventing proper cancellation of long-running operations with multiple tool calls.

This fix ensures abortSignal is propagated through all recursive calls, maintaining cancellation capability throughout the entire generation lifecycle.

Fixes issue where task cancellation fails when maxTurns > 1

Checklist (if applicable):

When generateHelper recursively calls itself during tool iterations,
the abortSignal was not being passed to the recursive call. This caused
abort signals to be lost after the first tool iteration, preventing
proper cancellation of long-running operations with multiple tool calls.

This fix ensures abortSignal is propagated through all recursive calls,
maintaining cancellation capability throughout the entire generation
lifecycle.

Fixes issue where task cancellation fails when maxTurns > 1
@longfin longfin marked this pull request as ready for review September 5, 2025 16:43
@longfin
Copy link
Contributor Author

longfin commented Sep 8, 2025

@pavelgj PTAL 🙏

@pavelgj
Copy link
Collaborator

pavelgj commented Sep 8, 2025

Good catch. Thanks!

@pavelgj pavelgj merged commit 429295c into firebase:main Sep 8, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants