fix: bound uncached remainder by prompt-max(cached,write) and forward compact prompt_cache_key

This commit is contained in:
CaIon
2026-07-11 22:18:26 +08:00
parent 48068ce923
commit 92d3c9d18f
9 changed files with 34 additions and 18 deletions
+6
View File
@@ -40,6 +40,11 @@ func ResponsesHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *
case *dto.OpenAIResponsesRequest:
responsesReq = req
case *dto.OpenAIResponsesCompactionRequest:
// Only fields documented for POST /v1/responses/compact are forwarded:
// model, input, instructions, previous_response_id, prompt_cache_key,
// prompt_cache_options, prompt_cache_retention, service_tier.
// Undocumented Codex-parity fields (tools, reasoning, text) are parsed
// for client compatibility but intentionally not sent upstream.
responsesReq = &dto.OpenAIResponsesRequest{
Model: req.Model,
Input: req.Input,
@@ -47,6 +52,7 @@ func ResponsesHelper(c *gin.Context, info *relaycommon.RelayInfo) (newAPIError *
PreviousResponseID: req.PreviousResponseID,
ParallelToolCalls: req.ParallelToolCalls,
ServiceTier: req.ServiceTier,
PromptCacheKey: req.PromptCacheKey,
PromptCacheOptions: req.PromptCacheOptions,
PromptCacheRetention: req.PromptCacheRetention,
}