Repository navigation
feat(api): update API spec from langfuse/langfuse 1ca8579 #2092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+28
−9
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟣 pre-existing, not blocking: Batch evaluation over observations can stop early and report itself complete with no resume token when the server returns an empty page that still carries a cursor. This change documents that contract but does not update the SDK's own pagination loop.
langfuse/batch_evaluation.py:1057breaks oncursor is None or not items, so an empty page ends the run as finished. Fix: end observation pagination only whenmeta.cursoris absent, and keep looping on empty pages. Same pattern at 2 sites (langfuse/batch_evaluation.py:1057, tests/support/utils.py:189).A small fix can ride a push you are already making; otherwise a short reply is enough.
Why this was flagged
The trigger is the API contract this change documents:
get_manycan returndata=[]whilemeta.cursoris set, withcommentfilled in (observations_v2meta.py:14-16). One example is a filter whose next matches fall outside the server's scan window.run_batched_evaluationon observations calls_fetch_batch_with_retry(batch_evaluation.py:1114-1123) and then runsif cursor is None or not items: has_more = False; breakat batch_evaluation.py:1057. The result therefore hascompleted=True,has_more_items=Falseandresume_token=None(lines 1080-1085), even though more matching observations exist. They are never scored, and the caller gets no token to resume from. The e2e helperget_observationsin tests/support/utils.py:189 stops the same way onnot response.data, so it can return a partial list. The base client did not document this, but the loop ignores the cursor whenever a page is empty.Verification: pre-existing. Trigger: the v2 observations endpoint returns
data=[]whilemeta.cursoris still set. The loop then runscursor = next_cursor; if cursor is None or not items: has_more = False; break(batch_evaluation.py:1056-1059). An empty page that still has a cursor therefore ends the run. The base commit has the same loop at 1056-1059.