Fix Bedrock stream first-event errors escaping FallbackModel
When a Bedrock ConverseStream fails on its first event (for example throttlingException), BedrockConverseModel.request_stream returned BedrockStreamedResponse without reading any event. The error then surfaced only when the caller started iterating, after FallbackModel had already handed the stream over, so the default fallback_on=(ModelAPIError,) never fired and the run failed instead of falling back.
Note: the report that Bedrock delivers throttlingException/serviceUnavailableException as first ConverseStream events is unverified here (no AWS credentials in the sandbox); the tests model throttlingException, consistent with the error classification in #9339/#9354.
Changes
pydantic_ai_slim/pydantic_ai/models/bedrock.py:request_streamreads the first ConverseStream event inside_map_api_errors(same peek-before-yield pattern as the Anthropic model), retains it asBedrockStreamedResponse._first_event, and_get_event_iteratorprepends it so the consumer sees every event exactly once. An empty event stream still completes with no events.tests/test_streaming_errors.py: a first-eventthrottlingExceptionnow triggers fallback to the backup model; the existing midstream-error behavior is unchanged.tests/models/test_bedrock.py: the retained first event is delivered exactly once (streamed deltas, final output,all_messages); empty event stream completes.
Tests: tests/test_streaming_errors.py::test_bedrock_peek_error_triggers_fallback and tests/test_streaming_errors.py::test_bedrock_midstream_error (3 passed), plus the full tests/models/test_bedrock.py (267 passed).
- Closes #10364
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration, release note, and exact API-check waiver.
- PR title is fit for the release changelog.