Repository navigation
feat(api): update API spec from langfuse/langfuse 9a75785 - #2120
langfuse-bot wants to merge 1 commit into
Conversation
|
@claude review |
There was a problem hiding this comment.
Claude Code Review
No review was started: this request came from a bot account. Manual reviews can only be requested by someone with write access to this repository. Ask a maintainer to comment @claude review, or have your automation post the comment from a user account with write access.
Tip: disable this comment in your organization's Code Review settings.
| auth_type: typing_extensions.Annotated[ | ||
| BlobStorageIntegrationAuthType, FieldMetadata(alias="authType") | ||
| ] |
There was a problem hiding this comment.
🔴 Callers on a self-hosted Langfuse server older than the authType release would get a ValidationError from every blob storage get, list or upsert, where the base parsed fine. New response fields are declared required with no default. Fix: give every newly added response field a default (= None for auth_type, an empty list for rule_ids), which covers the 2 sites listed. Same pattern at 2 sites (blob_storage_integration_response.py:28, unstable/topics/types/topic_facet.py:22).
Why this was flagged
This only matters if a caller upgrades the SDK while pointing at a Langfuse server that does not yet send authType or ruleIds, such as a self-hosted deployment that predates langfuse/langfuse 9a75785. BlobStorageIntegrationResponse.auth_type (blob_storage_integration_response.py:28-30) is annotated BlobStorageIntegrationAuthType with no default, so it is required. The raw client decodes 2xx bodies with parse_obj_as (core/pydantic_utilities.py:53-60), which calls TypeAdapter.validate_python. A body without authType therefore raises a pydantic ValidationError instead of returning data. On the base branch the same responses parse, because the field did not exist. TopicFacet.rule_ids (topic_facet.py:22-24) is also required via pydantic.Field(), so list_facets/get_facet fail the same way against servers without ruleIds. Nothing else guards against the missing key.
Verification: blob_storage_integration_response.py adds auth_type with no = ... default, so the field is required. topic_facet.py adds rule_ids: ... = pydantic.Field(), which is also required. In the base file this field does not exist, so the base parsed these responses fine. parse_obj_as (core/pydantic_utilities.py:53-60) raises a pydantic ValidationError when a required field is missing.
| auth_type: typing_extensions.Annotated[ | ||
| BlobStorageIntegrationAuthType, FieldMetadata(alias="authType") | ||
| ] |
There was a problem hiding this comment.
If a self-hosted server predates authType, the newly required auth_type field makes parse_obj_as raise ValidationError on its response. Listing integrations fails, and an upsert can save successfully before the client raises an error—even when callers use only access keys.
Give the new response field a backward-compatible default so upgrading the SDK does not require upgrading the server.
Prompt To Fix With AI
This is a comment left during a code review.
Path: langfuse/api/blob_storage_integrations/types/blob_storage_integration_response.py
Line: 28-30
Comment:
**Older server responses fail**
If a self-hosted server predates `authType`, the newly required `auth_type` field makes `parse_obj_as` raise `ValidationError` on its response. Listing integrations fails, and an upsert can save successfully before the client raises an error—even when callers use only access keys.
Give the new response field a backward-compatible default so upgrading the SDK does not require upgrading the server.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Generated from langfuse/langfuse
mainat 9a75785.The blob storage response model needs a backward-compatible default before merging.
Summary
Updates the generated SDK from the latest API definition.
Reviews (1) · Last reviewed commit: "feat(api): update API spec from langfuse..." · Reviewed by Greptile