Repository navigation
LLM contract tests via respx: OpenAI + Anthropic (replaces MagicMock) — #829 - #857
Merged
Merged
Conversation
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.
Closed
18 of 19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.