**test(executor): add unit tests for prompt cache key generation in OpenAI `cacheHelper`**
This commit is contained in:
Luis Pater
2026-03-05 22:49:23 +08:00
parent 4e1d09809d
commit ac135fc7cb
2 changed files with 68 additions and 0 deletions

View File

@@ -616,6 +616,10 @@ func (e *CodexExecutor) cacheHelper(ctx context.Context, from sdktranslator.Form
if promptCacheKey.Exists() {
cache.ID = promptCacheKey.String()
}
} else if from == "openai" {
if apiKey := strings.TrimSpace(apiKeyFromContext(ctx)); apiKey != "" {
cache.ID = uuid.NewSHA1(uuid.NameSpaceOID, []byte("cli-proxy-api:codex:prompt-cache:"+apiKey)).String()
}
}
if cache.ID != "" {