fix(client): close review gaps on list_providers — full shape, pagination, defensive health#165
Merged
saurabhjain1592 merged 1 commit intomainfrom Apr 28, 2026
Merged
Conversation
…tion, defensive health Three review-driven fixes on the just-shipped list_providers() (PR #164): 1. Wire-shape: LLMProvider was silently dropping endpoint, model, region, rate_limit, timeout_seconds, and settings — every provider config the SDK couldn't introspect. Surfaced all six fields so the SDK matches the platform's LLMProviderResource schema. 2. Pagination: GET /api/v1/llm-providers is paginated (server-side cap 100, default 20). list_providers() ignored that and would silently truncate results in any deployment with more than 20 providers. Added: - list_providers(page=, page_size=) — single page, list-shaped return - list_providers_paged(...) — single page, returns LLMProviderListResponse with pagination metadata - list_all_providers(...) — walks every page (page_size=100 default) 3. Defensive health parsing: a single malformed `health` snapshot on one provider would raise ValidationError out of pydantic and crash the entire list call. Wrapped the per-provider health construction in try/except and set health=None for the bad row, with a debug warning. 6 regression tests pin the new behavior, including the empty-string edge case in min_sdk_version_for("python") (no upgrade warning fires). Both async and sync entry points; types re-exported from `axonflow` (LLMProviderListResponse, PaginationMeta).
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.
Summary
Three review-driven fixes on the just-shipped `list_providers()` (PR #164). All three were flagged by the post-merge deep code review:
Wire-shape fields — `LLMProvider` was silently dropping `endpoint`, `model`, `region`, `rate_limit`, `timeout_seconds`, and `settings`. SDK callers couldn't introspect provider configuration despite the platform returning all six fields. Surfaced all six. The SDK now matches the platform's `LLMProviderResource` schema.
Pagination — `GET /api/v1/llm-providers` is paginated (server-side cap 100, default 20). `list_providers()` ignored that and would silently truncate results in any deployment with more than 20 providers. Added three flavours:
Defensive health parsing — a single malformed `health` snapshot on one provider would raise `ValidationError` out of pydantic and crash the entire list call. Wrapped the per-provider health construction in try/except and set `health=None` for the bad row, with a warning logged.
What changed
Test plan
6 new regression tests in `tests/test_list_providers_review_fixes.py`:
Cross-SDK note
The same review surfaced equivalent gaps in Go / TS / Java SDKs — each will get a sibling PR closing the same shape, pagination, and defensive-parsing concerns.