OpenAIResponsesCompactOptions
Properties
Section titled “Properties”truncationFallback?
Section titled “truncationFallback?”optional truncationFallback?: "auto" | "disabled";Server-side safety net. With ‘auto’, when the prompt exceeds the model’s context window, the OpenAI Responses API drops items from the beginning of the conversation (silently) instead of throwing a 400. With ‘disabled’ (default), the request fails — our client-side overflow recovery (PR-1) catches the error and retries.
Recommended setup: enable ‘auto’ on top of our existing client- side compaction. The client path stays the primary strategy (cheaper, observable, controllable); the server fallback covers the rare cases where our compaction is mid-flight or hasn’t caught up yet.
useSessionAsPromptCacheKey?
Section titled “useSessionAsPromptCacheKey?”optional useSessionAsPromptCacheKey?: boolean;When true, sets providerOptions.openai.promptCacheKey to a
stable per-session value derived from session.id. OpenAI’s
automatic prompt-cache (free, >1024 tokens) gets significantly
higher hit rates when subsequent turns from the same session
route to the same cache slot.