Skip to content

feat(api): update API spec from langfuse/langfuse 6191e50#857

Closed
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-6191e50
Closed

feat(api): update API spec from langfuse/langfuse 6191e50#857
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-6191e50

Conversation

@langfuse-bot

@langfuse-bot langfuse-bot commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This auto-generated PR (from the Fern SDK generator) updates the JS/TS client to reflect upstream API spec changes. It adds a new DashboardWidgets sub-client under the unstable namespace and separates the BlobStorageIntegrationFileType enum into a distinct response-only variant that includes PARQUET.

  • New DashboardWidgets client: Exposes a create method for POST /api/public/unstable/dashboard-widgets, with full type definitions for views, chart types, metrics, dimensions, filters, and sort options.
  • BlobStorageIntegrationFileTypeResponse: New type that widens the existing BlobStorageIntegrationFileType with a PARQUET value, used on response objects only (BlobStorageIntegrationResponse.fileType).
  • Critical generator bug in DashboardWidgets client: The error-handling switch statement duplicates case labels 400, 401, 403, and 405, making the second branches (top-level LangfuseAPI.* error classes) unreachable dead code and causing TypeScript TS2685 compile errors in strict mode.

Confidence Score: 2/5

Not safe to merge as-is — the generated DashboardWidgets client has duplicate switch case labels that will trigger TypeScript compile errors and leave several error-handling branches permanently unreachable.

The new DashboardWidgets client emits duplicate case labels (400, 401, 403, 405) in its error-handling switch block. TypeScript raises TS2685 for each duplicate, which breaks compilation in strict mode, and the second set of error classes (LangfuseAPI.Error, LangfuseAPI.UnauthorizedError, etc.) will never be thrown regardless. The rest of the PR — the BlobStorage type split and the Unstable client wiring — looks correct and clean.

packages/core/src/api/api/resources/unstable/resources/dashboardWidgets/client/Client.ts — duplicate switch case labels in the error-handling block

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant Caller
    participant Unstable as unstable.Client
    participant DW as DashboardWidgets
    participant API as POST /api/public/unstable/dashboard-widgets

    Caller->>Unstable: .dashboardWidgets (lazy init)
    Unstable-->>DW: new DashboardWidgets(options)
    Caller->>DW: .create(CreateDashboardWidgetRequest)
    DW->>API: POST (Basic Auth header)
    API-->>DW: 201 DashboardWidget
    DW-->>Caller: DashboardWidget (id, name, view, dimensions, metrics, ...)

    API-->>DW: 400 / 401 / 403 / 405
    Note over DW: Duplicate case labels:<br/>LangfuseAPI.unstable.* thrown (1st case wins)<br/>LangfuseAPI.* branches are dead code
    DW-->>Caller: throws unstable.BadRequestError etc.

    API-->>DW: 404
    DW-->>Caller: throws LangfuseAPI.NotFoundError
    API-->>DW: 429
    DW-->>Caller: throws unstable.TooManyRequestsError
    API-->>DW: 500
    DW-->>Caller: throws unstable.InternalServerError
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant Caller
    participant Unstable as unstable.Client
    participant DW as DashboardWidgets
    participant API as POST /api/public/unstable/dashboard-widgets

    Caller->>Unstable: .dashboardWidgets (lazy init)
    Unstable-->>DW: new DashboardWidgets(options)
    Caller->>DW: .create(CreateDashboardWidgetRequest)
    DW->>API: POST (Basic Auth header)
    API-->>DW: 201 DashboardWidget
    DW-->>Caller: DashboardWidget (id, name, view, dimensions, metrics, ...)

    API-->>DW: 400 / 401 / 403 / 405
    Note over DW: Duplicate case labels:<br/>LangfuseAPI.unstable.* thrown (1st case wins)<br/>LangfuseAPI.* branches are dead code
    DW-->>Caller: throws unstable.BadRequestError etc.

    API-->>DW: 404
    DW-->>Caller: throws LangfuseAPI.NotFoundError
    API-->>DW: 429
    DW-->>Caller: throws unstable.TooManyRequestsError
    API-->>DW: 500
    DW-->>Caller: throws unstable.InternalServerError
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
packages/core/src/api/api/resources/unstable/resources/dashboardWidgets/client/Client.ts:196-215
**Duplicate `case` labels make error branches unreachable**

The switch block contains duplicate cases for status codes `400`, `401`, `403`, and `405`. JavaScript/TypeScript evaluates only the **first** matching `case`, so the second set of `case 400` / `case 401` / `case 403` / `case 405` (lines 196–215) is dead code: `LangfuseAPI.Error`, `LangfuseAPI.UnauthorizedError`, `LangfuseAPI.AccessDeniedError`, and `LangfuseAPI.MethodNotAllowedError` (top-level namespace) will never be thrown. TypeScript also raises `TS2685 Duplicate case label` for each, which will fail a strict-mode build. This appears to be a Fern code-generator artefact and should be reported upstream.

Reviews (1): Last reviewed commit: "feat(api): update API spec from langfuse..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
langfuse-js Ready Ready Preview Jul 3, 2026 3:16pm

Request Review

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

@claude review

Comment on lines +196 to +215
case 400:
throw new LangfuseAPI.Error(
_response.error.body as unknown,
_response.rawResponse,
);
case 401:
throw new LangfuseAPI.UnauthorizedError(
_response.error.body as unknown,
_response.rawResponse,
);
case 403:
throw new LangfuseAPI.AccessDeniedError(
_response.error.body as unknown,
_response.rawResponse,
);
case 405:
throw new LangfuseAPI.MethodNotAllowedError(
_response.error.body as unknown,
_response.rawResponse,
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P0 Duplicate case labels make error branches unreachable

The switch block contains duplicate cases for status codes 400, 401, 403, and 405. JavaScript/TypeScript evaluates only the first matching case, so the second set of case 400 / case 401 / case 403 / case 405 (lines 196–215) is dead code: LangfuseAPI.Error, LangfuseAPI.UnauthorizedError, LangfuseAPI.AccessDeniedError, and LangfuseAPI.MethodNotAllowedError (top-level namespace) will never be thrown. TypeScript also raises TS2685 Duplicate case label for each, which will fail a strict-mode build. This appears to be a Fern code-generator artefact and should be reported upstream.

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/api/api/resources/unstable/resources/dashboardWidgets/client/Client.ts
Line: 196-215

Comment:
**Duplicate `case` labels make error branches unreachable**

The switch block contains duplicate cases for status codes `400`, `401`, `403`, and `405`. JavaScript/TypeScript evaluates only the **first** matching `case`, so the second set of `case 400` / `case 401` / `case 403` / `case 405` (lines 196–215) is dead code: `LangfuseAPI.Error`, `LangfuseAPI.UnauthorizedError`, `LangfuseAPI.AccessDeniedError`, and `LangfuseAPI.MethodNotAllowedError` (top-level namespace) will never be thrown. TypeScript also raises `TS2685 Duplicate case label` for each, which will fail a strict-mode build. This appears to be a Fern code-generator artefact and should be reported upstream.

How can I resolve this? If you propose a fix, please make it concise.

@claude claude 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.

LGTM — auto-generated Fern API client update adding the unstable dashboard-widgets resource and a new BlobStorageIntegrationFileTypeResponse enum.

Extended reasoning...

Overview

This PR is an auto-generated update to the Fern API client in packages/core/src/api/. It adds a new unstable.dashboardWidgets resource (types + client with a single create method targeting POST /api/public/unstable/dashboard-widgets) and introduces a new BlobStorageIntegrationFileTypeResponse enum (adds PARQUET to the response variant while the request variant is unchanged), swapping the response interface's fileType to the new type. All files are marked auto-generated by Fern.

Security risks

No security-relevant surface area. The dashboard widgets client uses the same BasicAuth pattern as every other resource, forwards the standard X-Langfuse-* headers, and JSON-serializes the request body. There is no user input parsing, cryptography, or authorization logic being introduced by this PR.

Level of scrutiny

Low. Fern-generated bindings are mechanical — the SDK follows the API definition, and the shape matches sibling resources (evaluationRules, evaluators) that already live under unstable. The only downstream change is the widening of BlobStorageIntegrationResponse.fileType to include PARQUET, which is additive and matches the doc comment explaining that PARQUET can be enabled via UI but not via the request API.

Other factors

No prior reviews to reconcile with. The bug hunting system reported no findings. Vercel preview built successfully. One minor codegen quirk worth noting: Client.ts contains duplicate case labels (400/401/403/405) in the error switch — the second set is unreachable — but this is a Fern-generated artifact identical to the pattern in other generated clients in this repo, not something this PR introduced.

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