Skip to content

feat: add implementation guide versioning and improve HTTP client reliability - #226

Open
fern-api[bot] wants to merge 4 commits into
mainfrom
fern-bot/2026-09-11_17-36-17_130
Open

fern-api[bot] wants to merge 4 commits into
mainfrom
fern-bot/2026-09-11_17-36-17_130

Conversation

@fern-api

@fern-api fern-api Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

17.0.0 → 17.1.0

Added

  • client.implementation_guides.create_version(...) and get_version(...) — new sync and async methods to publish and retrieve immutable exact canonical FHIR package versions beneath an implementation guide family; return ImplementationGuideVersionDetail.
  • client.lang2fhir_batch — new sync and async client covering the full batch FHIR extraction job lifecycle (create, upload_item, finalize, cancel, get, get_results, get_result, list).
  • client.profiles.versions — new sync and async client for managing immutable retained StructureDefinition versions (list, create, get, delete).
  • FhirImplementationGuide, ImplementationGuideVersionDetail, ConflictError, and supporting batch/profile-version models — new Pydantic models and error class exported from phenoml.implementation_guides and phenoml.implementation_guides.errors; ImplementationGuideSummary gains optional canonical_url and version_count fields.
  • BaseHttpResponse.response and quote_path_param — new property exposing the raw httpx.Response and new utility for percent-encoding path segment values.

Changed

  • token parameter on PhenomlClient and AsyncPhenomlClient — now accepts Union[str, Callable[[], str]], allowing a plain bearer token string to be passed directly without wrapping in a lambda.
  • client.implementation_guides.delete(...) — now also removes any exact canonical package versions beneath the guide in addition to name-level metadata.
  • OAuthTokenProvider — token refresh calls now explicitly pass grant_type="client_credentials" to ensure correct OAuth 2.0 client credentials flow behavior.
  • HTTP transport — TCP keepalive probes are now enabled on all connections via get_keepalive_socket_options(), and optional-body endpoints no longer send a Content-Type header when the body is empty; httpx-aiohttp version constraint relaxed from ==0.1.8 to ^0.1.8.

See full changelog


✅ Customizations automatically preserved in this update.


Note

Medium Risk
Touches authentication (token typing, OAuth refresh), HTTP request shaping, and destructive implementation-guide delete semantics—behavior changes that can affect production integrations even without breaking type signatures.

Overview
Release 17.1.0 regenerates the Fern Python SDK against an updated OpenAPI spec and bumps packaging/metadata (pyproject.toml, poetry.lock, bundled openapi.json).

Implementation guides gain create_version and get_version (sync/async) to publish and fetch immutable canonical FHIR packages under a guide family, with new models (FhirImplementationGuide, ImplementationGuideVersionDetail) and ConflictError for HTTP 409. delete is documented and wired to remove name-level metadata and exact package versions; ImplementationGuideSummary adds optional canonical_url and version_count.

Client ergonomics and transport: PhenomlClient / AsyncPhenomlClient accept token as a plain string or callable; OAuthTokenProvider refresh explicitly sends grant_type="client_credentials". The HTTP stack adds get_keepalive_socket_options(), optional_body handling so empty optional bodies omit Content-Type, quote_path_param, and BaseHttpResponse.response for raw httpx.Response access. Profile/version delete paths map 409 to ConflictError. Agent chat SSE parsing skips empty event data; Pydantic input alias coercion is centralized in shared helpers.

Reviewed by Cursor Bugbot for commit 017d333. Bugbot is set up for automated code reviews on this repo. Configure here.

fern-api Bot and others added 4 commits September 11, 2026 17:36
Generated by Fern
CLI Version: unknown
Generators:
  - fernapi/fern-python-sdk: 5.30.0
…ove HTTP client reliability

Add `create_version` and `get_version` methods to the implementation guides
client, enabling callers to publish and retrieve exact canonical FHIR package
versions beneath a guide family. Also improve HTTP client internals with TCP
keepalive support and correct `Content-Type` handling for optional-body endpoints.

Key changes:
- Add `create_version(name, *, implementation_guide, profile_refs, profile_context)` and `get_version(name, version)` to both sync and async `ImplementationGuidesClient`
- Introduce `get_keepalive_socket_options()` helper to configure TCP keepalive probes on all transports, preventing idle-connection drops by firewalls and load balancers
- Add `optional_body` flag to `get_request_body` and all `HttpClient` request methods; strip `Content-Type` header when an optional body resolves to empty
- Refactor `_coerce_keys_to_aliases` / `_get_field_aliases` into shared, cached helpers (using `weakref.WeakKeyDictionary`) for both Pydantic v1 and v2 model validators

🌿 Generated with Fern
Patches applied (1):
  - patch-6516695e: Release 15.0.2: restore bundled openapi.json packaging (#169)

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 017d333. Configure here.


headers: typing.Dict[str, str] = {
"User-Agent": "phenoml/17.0.0",
"User-Agent": "phenoml/0.0.0-fern-placeholder",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Placeholder leaked into User-Agent

Medium Severity

Every request now sends User-Agent: phenoml/0.0.0-fern-placeholder while X-Fern-SDK-Version correctly reports 17.1.0. The previous value phenoml/17.0.0 was replaced with an unsubstituted generator token, so production traffic no longer identifies this SDK version.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 017d333. Configure here.

opts.append((socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, intvl))
if hasattr(socket, "TCP_KEEPCNT"):
opts.append((socket.IPPROTO_TCP, socket.TCP_KEEPCNT, cnt))
return opts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keepalive options never applied

Medium Severity

get_keepalive_socket_options() is added and advertised as enabling TCP keepalive on all connections, but nothing calls it. Default httpx.Client and httpx.AsyncClient instances are still constructed without a transport that receives those socket options, so idle connections stay unprotected.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 017d333. Configure here.

This branch has not been deployed

No deployments
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.

0 participants