V4.2 Updated what ai_raw_response data is being captured. The changes were more extensive than I expected.

This commit is contained in:
Jim Lancaster
2026-08-14 07:21:15 -05:00
parent 28811d79ce
commit 6bd4cbb0a7
29 changed files with 2091 additions and 130 deletions
+16
View File
@@ -1,5 +1,6 @@
"""Tests for transcription.providers.openrouter."""
import asyncio
from types import SimpleNamespace
import pytest
@@ -143,6 +144,21 @@ class TestOpenRouterProviderTranscribe:
mime_type="image/png",
)
@pytest.mark.asyncio
async def test_preserves_caller_cancellation(self):
"""Caller and shutdown cancellation must not be relabeled as a timeout."""
provider = OpenRouterTranscriptionProvider(
settings=Settings(openrouter_api_key="test-key"),
client=_FakeClient(error=asyncio.CancelledError()),
)
with pytest.raises(asyncio.CancelledError):
await provider.transcribe(
prompt_text="Prompt body",
image_bytes=b"img-bytes",
mime_type="image/png",
)
@pytest.mark.asyncio
async def test_sends_pdf_as_file_content(self):
"""PDF payloads use OpenRouter's file content contract."""