You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
OpenAIConversationsSession get_items(limit>provider page size) forwards the session limit as provider page size #4757
OpenAIConversationsSession.get_items(limit=N) currently forwards N directly to conversations.items.list(limit=N). For large session limits this couples the SDK's local history cutoff to the provider's page-size constraints and can make an otherwise valid Session.get_items(limit=N) call fail before client pagination occurs.
A previous implementation attempt in #4721 confirmed the underlying bug. Maintainer guidance there was to avoid copying provider page-size constants into the SDK and instead omit limit from conversations.items.list(), letting the OpenAI client handle provider pagination while preserving the SDK's existing local cutoff.
Expected behavior: for a finite session limit, request items in descending order without forwarding the SDK limit as a provider page size, stop locally once N items are collected, then reverse them into chronological order.
Plan: stop forwarding the session limit as conversations.items.list(limit=…). Request items descending without a provider page-size copy, cut locally at N, reverse to chronological. Matches the guidance from #4721.
Thanks, that matches the intended fix. Please include a regression with a session limit above the provider page size and verify the returned items are still capped locally and chronological.
Activity
tiagovilasboas commentedon Sep 11, 2026
I'd like to take this.
Plan: stop forwarding the session
limitasconversations.items.list(limit=…). Request items descending without a provider page-size copy, cut locally at N, reverse to chronological. Matches the guidance from #4721.sylvesterkaczmarek commentedon Sep 12, 2026
Thanks, that matches the intended fix. Please include a regression with a session limit above the provider page size and verify the returned items are still capped locally and chronological.