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.
OpenAIConversationsSession.get_items(limit=N)currently forwardsNdirectly toconversations.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 validSession.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
limitfromconversations.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.