Repository navigation
Conversation
A /v1/responses request with store=false and no conversation or
previous_response_id comes from a stateless client that resends the full
history as input on every request (e.g. a Chat Completions to Responses
proxy). lightspeed-stack still auto-created a conversation and passed it
to OGX, which then copied the entire input into the conversation after
the response. OGX adds those items with a single AddItemsRequest, which
is limited to 20 items, so once the history grew past that every request
failed after streaming the output:
1 validation error for AddItemsRequest
items
List should have at most 20 items after validation, not 22
For such requests, set omit_conversation so the conversation parameter
isn't sent to OGX, and skip topic summary generation, whose result is
only used when the turn is stored.
PendingTurn.for_request() treated any request with omit_conversation as
compacted and required its original input; accept a store=false request
without one, since its turn is never stored.
|
No actionable comments were generated in the recent review. WalkthroughFor ChangesStateless Responses handling
Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Possibly related PRs
Suggested labels: Suggested reviewers: Merge Risk:
|
|
/ok-to-test |
Description
A /v1/responses request with store=false and no conversation or previous_response_id comes from a stateless client that resends the full history as input on every request (e.g. a Chat Completions to Responses proxy). lightspeed-stack still auto-created a conversation and passed it to OGX, which then copied the entire input into the conversation after the response. OGX adds those items with a single AddItemsRequest, which is limited to 20 items, so once the history grew past that every request failed after streaming the output:
For such requests, set omit_conversation so the conversation parameter isn't sent to OGX, and skip topic summary generation, whose result is only used when the turn is stored.
PendingTurn.for_request() treated any request with omit_conversation as compacted and required its original input; accept a store=false request without one, since its turn is never stored.
Note:
store: truethat add more than 20 items at once. That would be a separate thing, and would require a change to OGX.conversationoptional in many places.Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Checklist before requesting a review
Testing
test_stateless_request_omits_conversation_and_topic_summary(tests/unit/app/endpoints/test_responses.py) and
test_stateless_request_without_conversation_stores_nothing(tests/unit/utils/test_pending_turn.py). Existing unit tests pass.
store: false, noconversation/previous_response_id,and 20+ input items (e.g. a user message plus 10 function_call/function_call_output pairs)
1 validation error for AddItemsRequest ... at most 20 items;after:
response.completedtested with Vertex AI (Gemini) and Ollama backends, with up to 82 input items. The only
functional difference on main is the PendingTurn change, which is covered by the new unit test.
Summary by CodeRabbit