Repository navigation
Add sign-in session and sign-in event methods - #2083
Merged
Merged
Conversation
Client.get_sign_in_sessions and Client.get_sign_in_events read the Performance API's /workspace/sign-in-sessions and /workspace/sign-in-events: the sign-in history of the organization's own members, for callers with the organization-wide permission to view all performance. Both page by the API's opaque nextCursor, which has no total, through a new PerformanceCursorRows. SignInEventRows adds complete_through, taken from the last page once the feed has been read to the end. Rows are typed as SignInSession and SignInEvent, with str enums for status, start kind, end reason and event type. The status filter is sent in lower case, as the API takes it; a session's own status is in capitals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
manuaero
requested review from
carl-l-chua,
gmadaan-hue,
gramos-lb,
ikerr,
john-labelbox,
snmodi21 and
vikram-kharvi
October 15, 2026 23:58
Merged
This branch was previously deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Labelbox's Performance REST API now gives organization admins the sign-in history of their own members (Labelbox/intelligence#31588, #31590, live in production since 2026-10-15). This adds it to the SDK. No ticket.
What's added:
Client.get_sign_in_sessions(start_date, end_date, user_ids=None, user_group_ids=None, status=None, page_size=100)andClient.get_sign_in_events(start_date, end_date, user_ids=None, user_group_ids=None, types=None, include_derived=True, page_size=100). Filters take IDs or SDK objects, and an empty list raisesValueError, like the existing performance methods.SignInSessionandSignInEvent, and enumsSignInSessionStatus,SignInStartKind,SignInEndReason,SignInEventType. Unknown fields are ignored. The docstrings say what a derived end (MAX_DURATION_REACHED,end_derived=True) means: the latest the session could last, not when the member stopped working. They also say thatduration_secondsis not time worked.PerformanceCursorRowsfollows it as you iterate, requests nothing until then, and starts again on a second pass.SignInEventRowsaddscomplete_through, taken from the last page.labelboxand listed in the Sphinxperformance.rst. The version and changelog are left to the Prep PR.Readable only with the organization-wide permission to view all performance; only sessions started in the caller's organization are listed.
Checked against production
The branch's methods were run against production with a real API key (counts only):
statusopen + ended add up to all;user_idsreturns only that member.complete_through, which isNoneuntil read to the end;types=[SIGN_OUT], include_derived=Falsereturns 1,143 recorded sign-outs and no derived ones.ValueErrorbefore any request; a 40-day window raisesInvalidQueryErrornamingendDate.Tests
tests/unit/schema/test_performance.py: 154 tests pass, about 54 of them new. They cover:UserGroupobjects;status;includeDerivedsent only when false;complete_through;The important tests were checked to fail without the change.
ruff@0.8.4format and check, andmypy, are clean.Before opening, the change and its guide were reviewed against the API code by four independent reviewers, each finding checked by two more. The upheld findings (wording about the 84-hour maximum, durations, naive datetimes, and who is listed) are fixed, and the fixes were checked again.
The user guide is Labelbox/lbx-docs-mintlify#301, to merge once 7.15.0 is on PyPI. Release as 7.15.0 after this merges.
Type of change
All Submissions
New Feature Submissions
Changes to Core Features
🤖 Generated with Claude Code