Skip to content

test(litigation): cover provider factory selection and OpenRouter config - #101

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-d641
Draft

test(litigation): cover provider factory selection and OpenRouter config#101
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/missing-test-coverage-d641

Conversation

@cursor

@cursor cursor Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Risky behavior now covered

  • Litigation runner get_provider() factory: ollama/lm_studio/openrouter selection, case-insensitive provider names, and unknown-provider rejection
  • OpenRouter API key requirement (OPENROUTER_API_KEY env or explicit key)
  • OpenRouter attribution headers (HTTP-Referer, X-Title) and routing extra_body (provider, user) passed through to OpenAICompatProvider

Test files added/updated

  • tests/test_litigation_providers.py (8 tests, new)

Why these tests materially reduce regression risk

The litigation runner depends on correct provider wiring for every courtroom session. A regression in factory selection or OpenRouter config propagation would silently route requests to the wrong backend or omit required headers. These tests lock the factory contract without requiring live API calls.

Validation: pip install -e ".[dev]" && python3 -m pytest tests/ — 68 passed

Open in Web View Automation 

Add regression tests for get_provider (ollama, lm_studio, openrouter),
OpenRouter header/extra_body builders, and missing API key validation.

Co-authored-by: exios4 <exios4@protonmail.com>
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