fix(executor): add logging and prompt cache key handling for OpenAI responses
Browse files
internal/runtime/executor/codex_executor.go
CHANGED
|
@@ -508,6 +508,11 @@ func (e *CodexExecutor) cacheHelper(ctx context.Context, from sdktranslator.Form
|
|
| 508 |
codexCacheMap[key] = cache
|
| 509 |
}
|
| 510 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
}
|
| 512 |
|
| 513 |
rawJSON, _ = sjson.SetBytes(rawJSON, "prompt_cache_key", cache.ID)
|
|
|
|
| 508 |
codexCacheMap[key] = cache
|
| 509 |
}
|
| 510 |
}
|
| 511 |
+
} else if from == "openai-response" {
|
| 512 |
+
promptCacheKey := gjson.GetBytes(req.Payload, "prompt_cache_key")
|
| 513 |
+
if promptCacheKey.Exists() {
|
| 514 |
+
cache.ID = promptCacheKey.String()
|
| 515 |
+
}
|
| 516 |
}
|
| 517 |
|
| 518 |
rawJSON, _ = sjson.SetBytes(rawJSON, "prompt_cache_key", cache.ID)
|