SIGN IN SIGN UP

fix: omit cachePoint-only Bedrock assistant messages after reasoning filtering (#19858)

## Background

Bedrock conversations containing an aborted unsigned reasoning turn with
a cache point sent an invalid cachePoint-only assistant message, causing
repeated non-retryable 400 errors.

## Root Cause

The assistant-message guard checked only whether converted content was
non-empty. Adding a cache point made the array non-empty after unsigned
reasoning was filtered, so the invalid message remained; the failing
regression test confirmed the exact malformed output.

## Summary

The Bedrock converter now emits assistant messages only when at least
one non-cache-point content block remains. Reproduction artifacts were
removed and a patch changeset was added.

## Testing

Added regression coverage verifying that unsigned reasoning with a cache
point is omitted while surrounding user messages remain.

## End-to-end Validation

- `pnpm -C examples/ai-functions exec tsx
src/reproduction/amazon-bedrock-cache-point-only-assistant.ts` via
immutable replay — both live Bedrock follow-up requests completed
without the malformed assistant message or prior 400 error.

## Related Issues

Fixes #19851

Closes #19855

---------

Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
Co-authored-by: nabilfreeman <2470659+nabilfreeman@users.noreply.github.com>
A
ai-sdk-factory[bot] committed
030b4e15b84273763b80057d8410fa203acfefaf
Parent: 39e8870
Committed by GitHub <noreply@github.com> on 8/27/2026, 9:57:23 PM