Skip to content

LLM contract tests via respx: OpenAI + Anthropic (replaces MagicMock) — #829 - #857

Merged
AmitoVrito merged 1 commit into
mainfrom
feat/issue-829-llm-respx-contract-tests
Jul 22, 2026
Merged

AmitoVrito merged 1 commit into
mainfrom
feat/issue-829-llm-respx-contract-tests

Conversation

@AmitoVrito

Copy link
Copy Markdown
Collaborator

Opens the LLM-provider track of epic #829. Replaces MagicMock with real respx HTTP-contract tests for OpenAI and Anthropic: respx intercepts the real httpx call each SDK makes and streams back real SSE, so the tests exercise the actual request body, SSE/event parsing, token counting, and auth headers — not a faked client. Runs in the fast test job (no container). 6/6 pass. OpenAI establishes the pattern for the whole OpenAI-compatible family (Groq/DeepSeek/xAI/…); Anthropic covers the event-typed Messages stream. Both providers correct as-is. Remaining providers + a real Ollama container are tracked on #829.

Start the LLM-provider track by replacing MagicMock with real respx HTTP-contract
tests: respx intercepts the actual httpx call each SDK makes and streams back real
SSE, so these exercise the real request body the SDK builds, the real chunk/event
parsing, token accounting, and auth headers — not a hand-faked client. Runs in the
fast test job (no container). OpenAI covers the OpenAI-compatible provider family;
Anthropic covers the event-typed Messages stream. Both providers are correct as-is.

respx/openai/anthropic added to the dev group so these run (not skip) in CI.

Part of #829.
@AmitoVrito
AmitoVrito merged commit a47a6a2 into main Jul 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant