Skip to content

feat(openrouter): validate model capabilities from OpenRouter metadata#143

Merged
seanbrar merged 1 commit intomainfrom
feat/openrouter-metadata-validation
Mar 6, 2026
Merged

feat(openrouter): validate model capabilities from OpenRouter metadata#143
seanbrar merged 1 commit intomainfrom
feat/openrouter-metadata-validation

Conversation

@seanbrar
Copy link
Owner

@seanbrar seanbrar commented Mar 6, 2026

Summary

Validate OpenRouter models against the OpenRouter models API before dispatch. This keeps the OpenRouter provider honest about model availability and lets Pollux distinguish between features a model does not support and features Pollux has intentionally deferred to later OpenRouter PRs.

Related issue

None

Test plan

  • uv run pytest tests/test_providers.py -q -k openrouter
  • just check

Notes

  • Adds an internal metadata cache with TTL and a lock to avoid duplicate /models fetches across concurrent validations.
  • Keeps the change local to the OpenRouter provider; this PR does not widen Pollux's core capability abstraction.
  • Improves errors for unsupported-by-model vs not-yet-implemented-in-Pollux OpenRouter features.

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

❌ Patch coverage is 80.58252% with 20 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/pollux/providers/openrouter.py 80.58% 20 Missing ⚠️

📢 Thoughts on this report? Let us know!

@seanbrar seanbrar merged commit 28ba2d4 into main Mar 6, 2026
10 checks passed
@seanbrar seanbrar deleted the feat/openrouter-metadata-validation branch March 6, 2026 09:37
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