SIGN IN SIGN UP

fix: continue chats automatically after denied tool approvals (#19771)

## Background

Denied tool approvals left sendAutomaticallyWhen blocked even after all
tool invocations reached terminal states, preventing chat continuation.

## Root Cause

The approval-completion predicate omitted the valid output-denied
terminal state from its every check; the original reproduction and new
regression test both returned false for mixed approval-responded and
output-denied states.

## Summary

Added output-denied to the terminal-state check, added regression
coverage, and included an ai package patch changeset.

## Testing

Added a unit test verifying that mixed approval-responded and
output-denied tool states satisfy the continuation predicate.

## End-to-end Validation

- `pnpm -C examples/ai-functions exec tsx
src/reproduction/issue-13670-denied-tool-approval.ts` via immutable
replay exited successfully and observed `true` without the original bug
signal.

## Related Issues

Fixes #13670

Closes #19591

---------

Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Co-authored-by: toomingos <86632157+toomingos@users.noreply.github.com>
A
ai-sdk-factory[bot] committed
fda13b3a04a488eb73e62349f1e075b73526dcc8
Parent: ce6849a
Committed by GitHub <noreply@github.com> on 8/26/2026, 10:01:18 PM