Repository navigation
feat(api): update API spec from langfuse/langfuse 570909d - #999
langfuse-bot wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@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.
| public create( | ||
| request: LangfuseAPI.CreateScoreRequest, | ||
| request: LangfuseAPI.CreateScoresRequest, | ||
| requestOptions?: Scores.RequestOptions, | ||
| ): core.HttpResponsePromise<LangfuseAPI.CreateScoreResponse> { | ||
| ): core.HttpResponsePromise<LangfuseAPI.CreateScoresResponse> { |
There was a problem hiding this comment.
Scores.create() now returns HttpResponsePromise<CreateScoresResponse> even for a single score. ScoreV1.create() still returns that call as HttpResponsePromise<CreateScoreResponse>. The batch responses lack id, so these types are incompatible and the core package fails TypeScript checking.
Add overloads that preserve CreateScoreResponse for single-score requests and return the batch response types for arrays.
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/api/api/resources/scores/client/Client.ts
Line: 93-96
Comment:
**Score types break compilation**
`Scores.create()` now returns `HttpResponsePromise<CreateScoresResponse>` even for a single score. `ScoreV1.create()` still returns that call as `HttpResponsePromise<CreateScoreResponse>`. The batch responses lack `id`, so these types are incompatible and the core package fails TypeScript checking.
Add overloads that preserve `CreateScoreResponse` for single-score requests and return the batch response types for arrays.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| * } | ||
| */ | ||
| export interface GetSkillFileContentsRequest { | ||
| /** Comma-separated list of one to 50 canonical base64-encoded SHA-256 hashes from skill file manifests. URL-encode the value, including +, /, and = characters. */ |
There was a problem hiding this comment.
Hash instructions encode twice
The sha256Hashes comment tells callers to URL-encode the value, but the client already does this. Following that instruction turns %2B, %2F, and %3D into %252B, %252F, and %253D. The server then receives escaped text instead of canonical base64 hashes.
Tell callers to pass raw, comma-separated hashes and let the client encode them.
| /** Comma-separated list of one to 50 canonical base64-encoded SHA-256 hashes from skill file manifests. URL-encode the value, including +, /, and = characters. */ | |
| /** Comma-separated list of one to 50 canonical base64-encoded SHA-256 hashes from skill file manifests. Pass raw hashes; the client URL-encodes the value automatically. */ |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/core/src/api/api/resources/unstable/resources/skills/client/requests/GetSkillFileContentsRequest.ts
Line: 12
Comment:
**Hash instructions encode twice**
The `sha256Hashes` comment tells callers to URL-encode the value, but the client already does this. Following that instruction turns `%2B`, `%2F`, and `%3D` into `%252B`, `%252F`, and `%253D`. The server then receives escaped text instead of canonical base64 hashes.
Tell callers to pass raw, comma-separated hashes and let the client encode them.
```suggestion
/** Comma-separated list of one to 50 canonical base64-encoded SHA-256 hashes from skill file manifests. Pass raw hashes; the client URL-encodes the value automatically. */
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
I reviewed this PR and didn't find any bugs. Because it's a large auto-generated regeneration touching many API client files, a human look would still be worthwhile.
What was reviewed: the ingestion→scores type renames (SdkLogBody/SdkLogEvent exports removed, replaced by new CreateScoreBatch*/CreateScores* types, consistently re-exported in scores/types/index.ts); the new skills sub-resource wiring into unstable/client/Client.ts and unstable/resources/index.ts; the OrganizationApiKey name/deprecated note field addition; and the expiresAt nullability typing across ApiKeyResponse/ApiKeySummary/OrganizationApiKey (inconsistency present but inherited from the spec, not a new bug introduced here).
Extended reasoning...
This is a Fern-generated regeneration of the Langfuse API client (55 files, 1442 insertions/35 deletions) adding a new unstable skills resource, renaming ingestion SdkLog types into new scores batch types, and adding fields to OrganizationApiKey/ApiKeyResponse/ApiKeySummary and a prompts list filter param; no hand-written logic, no auth/crypto changes, purely generated typings and client wiring. The bug hunt reported no findings; I independently spot-checked the index.ts export renames and the new skills client wiring for consistency and found them correct. The one candidate issue noted (ApiKeySummary/OrganizationApiKey expiresAt missing | null unlike ApiKeyResponse) is a pre-existing spec-inherited typing quirk, not a newly introduced bug, so it was ruled out rather than flagged. Given the sheer size and scope of files touched, I'm deferring rather than approving outright.
Fix the incompatible score return types before merging.
Summary
Updates the generated API client with batch score creation, experimental skills endpoints, prompt filters, API key names and expiration, and ingestion migration guidance.
Reviews (1) · Last reviewed commit: "feat(api): update API spec from langfuse..." · Reviewed by Greptile