Skip to content

fix(client): close review gaps on listLLMProviders — full shape, pagination, encoding#148

Merged
saurabhjain1592 merged 2 commits into
mainfrom
feature/qf-review-fixes
Apr 28, 2026
Merged

fix(client): close review gaps on listLLMProviders — full shape, pagination, encoding#148
saurabhjain1592 merged 2 commits into
mainfrom
feature/qf-review-fixes

Conversation

@saurabhjain1592

Copy link
Copy Markdown
Member

Summary

Six review-driven fixes on the just-shipped `listLLMProviders` (PR #145). All flagged by the post-merge deep code review.

What changed

# Issue Fix
1 `LLMProvider` was silently dropping six platform-emitted fields Added `endpoint`, `model`, `region`, `rateLimit`, `timeoutSeconds`, `settings: Map<String, Object>`
2 Pagination ignored — silent truncation at 20 providers New overload `listLLMProviders(type, enabled, page, pageSize)`. New `listLLMProvidersPaged(...)` returns `LLMProviderListResponse` with pagination metadata. New `listAllLLMProviders(...)` walks every page (default `pageSize=100`)
3 Manual `StringBuilder` query string didn't URL-encode reserved chars Switched to `HttpUrl.Builder` so `type=custom&weird` is encoded as `type=custom%26weird`
4 Primitive `boolean enabled` couldn't distinguish "explicitly false" from "field omitted" Retyped as boxed `Boolean` / `Integer`. Added convenience `isEnabled()` / `hasApiKey()` returning primitive `false` on null
5 Duplicate `@JsonProperty("last_checked")` on getter Removed the getter-side annotation; the constructor-parameter annotation is sufficient
6 Tests didn't cover combined filters or URL encoding Added 7 new tests

New types

  • `com.getaxonflow.sdk.types.LLMProviderListResponse` (providers + pagination)
  • `com.getaxonflow.sdk.types.PaginationMeta` (page, page_size, total_items, total_pages)

Test plan

  • `mvn compile` clean
  • `mvn test -Dtest='AxonFlowTest'` — 163/163 pass (existing + 7 new)
  • Wire-shape contract gate green
  • No changes to public method names that already shipped — only additive overloads + new types

New tests in AxonFlowTest

  • `llmProviderSurfacesAllOptionalFields`
  • `listLLMProvidersPagedReturnsPaginationMeta`
  • `listAllLLMProvidersWalksEveryPage`
  • `listLLMProvidersCombinedFilters` (type + enabled together)
  • `listLLMProvidersURLEncodesType` (reserved chars)
  • `llmProviderWithNullHealth`
  • `llmProviderEnabledIsBoxed` (omitted field → null, isEnabled() returns false)

Cross-SDK note

Sibling PRs landing the same fixes: axonflow-sdk-python#165, axonflow-sdk-go#142, axonflow-sdk-typescript#200.

…nation, encoding

Six review-driven fixes on the just-shipped listLLMProviders (PR #145):

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. enabled/priority/
   weight/hasApiKey are now boxed (Boolean/Integer) so a missing JSON
   value is distinguishable from explicit false/0.

2. Pagination: GET /api/v1/llm-providers is paginated (server cap 100,
   default 20). The 2-arg listLLMProviders ignored that and would silently
   truncate results in any deployment with >20 providers. Added:
   - listLLMProviders(type, enabled, page, pageSize) — single page
   - listLLMProvidersPaged(...) — single page + LLMProviderListResponse
     (with PaginationMeta)
   - listAllLLMProviders(type, enabled[, pageSize]) — walks every page

3. URL encoding: query string is now built with HttpUrl.Builder instead
   of manual StringBuilder concat. Reserved chars in `type` filter
   (e.g. "&") are now properly URL-encoded.

4. Duplicate @JsonProperty: removed the redundant annotation on
   LLMProviderHealth.getLastChecked() — the constructor parameter
   annotation is sufficient.

5. Boxed booleans: LLMProvider.getEnabled() / getHasApiKey() return
   Boolean (nullable) so callers can distinguish "explicitly false"
   from "field omitted by older platform". Convenience isEnabled() /
   hasApiKey() return primitive boolean (false on null).

6. New types: LLMProviderListResponse, PaginationMeta in types/ package.

7 new regression tests in AxonFlowTest cover: full-shape round-trip,
pagination metadata, multi-page walk, combined filters (type+enabled),
URL encoding for reserved chars, null health field, omitted-enabled
boxed-Boolean behaviour. 163 total tests pass.
@saurabhjain1592 saurabhjain1592 added the spec-pin-bump Authorizes a wire-shape baseline openapi_specs_sha bump (otherwise CI blocks SHA changes) label Apr 28, 2026
@saurabhjain1592 saurabhjain1592 force-pushed the feature/qf-review-fixes branch from d9bf7bd to e53e6fc Compare April 28, 2026 15:23
@saurabhjain1592 saurabhjain1592 merged commit ce37761 into main Apr 28, 2026
12 checks passed
saurabhjain1592 added a commit that referenced this pull request Apr 28, 2026
…imitive shape (#151)

Code-review finding on PR #148: the new 13-arg boxed constructor
replaced the public 7-arg primitive shape, and getPriority() /
getWeight() changed from `int` to `Integer`. That's a real breaking
change in a PR framed as additive — pre-existing callers either
fail to compile (constructor) or now see nullable return values
where they expected primitives (accessors).

This PR preserves source compatibility while keeping the boxed
storage that the wire-shape contract needs:

  1. Add a 7-arg primitive constructor that delegates to the new
     13-arg one with nulls for the post-PR-#148 optional fields.
     Marked @deprecated to nudge new callers toward the boxed form.

  2. getPriority() and getWeight() return primitive `int` again
     (null-safe-unbox to 0). Boxed access is via the new
     getPriorityBoxed() / getWeightBoxed() methods.

  3. getEnabled() (which was BRAND NEW in PR #148, returning
     Boolean) is renamed to getEnabledBoxed() so the JavaBeans-style
     name doesn't lure callers into `boolean e = p.getEnabled()`
     and an NPE on null. Pre-PR-#148 had no getEnabled() so this
     rename has no consumers.

  4. Same Boxed-suffix pattern applied to getHasApiKey →
     getHasApiKeyBoxed for symmetry; primitive `boolean hasApiKey()`
     was already there from before #148.

Two new regression tests pin the source-compat shape:
  - llmProviderLegacyConstructorPreservesSourceCompat — exercises
    the 7-arg primitive constructor and confirms primitive-returning
    accessors round-trip correctly.
  - llmProviderPrimitiveAccessorsNullSafe — confirms primitive
    accessors null-safe-unbox to 0 / false when the boxed field is
    null (which is what Jackson produces when the JSON field is
    omitted).

Existing test that asserted on `p.getEnabled()` updated to
`p.getEnabledBoxed()` to match the new naming.

Wire-shape baseline refreshed — the renamed getter is not part of
the wire contract (Jackson reads via constructor), but the validator
records SDK class shape and noticed the rename. No spec drift.
saurabhjain1592 added a commit that referenced this pull request Apr 28, 2026
…ernal entry + scrub PR ref

Cleanup pass on the Java SDK [Unreleased] section ahead of release tagging.

- Rename [Unreleased] → [6.2.0] - 2026-04-28. Minor bump (new
  listLLMProviders + LLMProvider source-compat restoration).
- Add release header description aligned with prior version sections.
- Remove the pom.xml skipUnitTests entry — pure CI plumbing, violates
  feedback_changelog_no_internal_entries.md.
- Scrub the LLMProvider entry: drop the "review-driven follow-up to
  PR #148" meta-narrative and the internal PR-number reference, keep
  the user-facing facts (constructor + return-type restoration, boxed
  accessor names). Aligns with feedback_no_internal_refs_changelog.md.
- Tighten the LLMProvider entry to one paragraph in the prior-section
  tone.
- Keep an empty [Unreleased] heading per Keep-a-Changelog convention.

No code changes.
saurabhjain1592 added a commit that referenced this pull request Apr 28, 2026
…ernal entry + scrub PR ref (#153)

Cleanup pass on the Java SDK [Unreleased] section ahead of release tagging.

- Rename [Unreleased] → [6.2.0] - 2026-04-28. Minor bump (new
  listLLMProviders + LLMProvider source-compat restoration).
- Add release header description aligned with prior version sections.
- Remove the pom.xml skipUnitTests entry — pure CI plumbing, violates
  feedback_changelog_no_internal_entries.md.
- Scrub the LLMProvider entry: drop the "review-driven follow-up to
  PR #148" meta-narrative and the internal PR-number reference, keep
  the user-facing facts (constructor + return-type restoration, boxed
  accessor names). Aligns with feedback_no_internal_refs_changelog.md.
- Tighten the LLMProvider entry to one paragraph in the prior-section
  tone.
- Keep an empty [Unreleased] heading per Keep-a-Changelog convention.

No code changes.
@saurabhjain1592 saurabhjain1592 deleted the feature/qf-review-fixes branch May 12, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec-pin-bump Authorizes a wire-shape baseline openapi_specs_sha bump (otherwise CI blocks SHA changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant