mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-19 04:40:52 +08:00
fix(codex): avoid empty prompt_cache_key
This commit is contained in:
@@ -622,13 +622,17 @@ func (e *CodexExecutor) cacheHelper(ctx context.Context, from sdktranslator.Form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rawJSON, _ = sjson.SetBytes(rawJSON, "prompt_cache_key", cache.ID)
|
if cache.ID != "" {
|
||||||
|
rawJSON, _ = sjson.SetBytes(rawJSON, "prompt_cache_key", cache.ID)
|
||||||
|
}
|
||||||
httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(rawJSON))
|
httpReq, err := http.NewRequestWithContext(ctx, http.MethodPost, url, bytes.NewReader(rawJSON))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
httpReq.Header.Set("Conversation_id", cache.ID)
|
if cache.ID != "" {
|
||||||
httpReq.Header.Set("Session_id", cache.ID)
|
httpReq.Header.Set("Conversation_id", cache.ID)
|
||||||
|
httpReq.Header.Set("Session_id", cache.ID)
|
||||||
|
}
|
||||||
return httpReq, nil
|
return httpReq, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user