mirror of
https://github.com/openai/codex.git
synced 2026-05-29 15:30:22 +00:00
Inherit forked agent prompt cache keys
(cherry picked from commit 61807cc6cf4c870ce643394739f99b8076b69894)
This commit is contained in:
@@ -31,6 +31,7 @@ pub struct ResponsesClient<T: HttpTransport> {
|
||||
#[derive(Default)]
|
||||
pub struct ResponsesOptions {
|
||||
pub conversation_id: Option<String>,
|
||||
pub prompt_cache_key: Option<String>,
|
||||
pub session_source: Option<SessionSource>,
|
||||
pub extra_headers: HeaderMap,
|
||||
pub compression: Compression,
|
||||
@@ -73,6 +74,7 @@ impl<T: HttpTransport> ResponsesClient<T> {
|
||||
) -> Result<ResponseStream, ApiError> {
|
||||
let ResponsesOptions {
|
||||
conversation_id,
|
||||
prompt_cache_key,
|
||||
session_source,
|
||||
extra_headers,
|
||||
compression,
|
||||
@@ -89,7 +91,8 @@ impl<T: HttpTransport> ResponsesClient<T> {
|
||||
if let Some(ref conv_id) = conversation_id {
|
||||
insert_header(&mut headers, "x-client-request-id", conv_id);
|
||||
}
|
||||
headers.extend(build_conversation_headers(conversation_id));
|
||||
let session_id = prompt_cache_key.or_else(|| conversation_id.clone());
|
||||
headers.extend(build_conversation_headers(session_id));
|
||||
if let Some(subagent) = subagent_header(&session_source) {
|
||||
insert_header(&mut headers, "x-openai-subagent", &subagent);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user