Parent: #93
Responses rehydration currently loads record.messages, clones the full stored array into ResponsesState, and later persists accumulated state into the next response record. That leaves proxy memory and DB growth unbounded across chained previous_response_id turns.
Scope:
- Add a default-enabled
max_history_bytes guard to openai_responses_rehydrate.
- Consider an optional
max_history_items guard for operational clarity.
- Enforce before cloning/splicing stored history into request state.
- Enforce before persisting accumulated
ResponsesState.messages into the response store.
- Return
413 Payload Too Large with guidance to compact before continuing.
- Add regression tests for oversized stored history and oversized accumulated history.
Notes:
- OpenAI
context_management.compact_threshold and truncation are backend/model-context controls; they do not protect Praxis from loading large DB-backed history before forwarding to the inference backend.
- This follow-up was split out from review of the Responses rehydrate filter.
Parent: #93
Responses rehydration currently loads
record.messages, clones the full stored array intoResponsesState, and later persists accumulated state into the next response record. That leaves proxy memory and DB growth unbounded across chainedprevious_response_idturns.Scope:
max_history_bytesguard toopenai_responses_rehydrate.max_history_itemsguard for operational clarity.ResponsesState.messagesinto the response store.413 Payload Too Largewith guidance to compact before continuing.Notes:
context_management.compact_thresholdandtruncationare backend/model-context controls; they do not protect Praxis from loading large DB-backed history before forwarding to the inference backend.