mirror of
https://github.com/openai/codex.git
synced 2026-05-29 15:30:22 +00:00
feat: add mem 2 agent header (#18644)
Add a header to memory phase 2 agent for analytics
This commit is contained in:
@@ -131,6 +131,7 @@ pub const X_CODEX_TURN_STATE_HEADER: &str = "x-codex-turn-state";
|
||||
pub const X_CODEX_TURN_METADATA_HEADER: &str = "x-codex-turn-metadata";
|
||||
pub const X_CODEX_PARENT_THREAD_ID_HEADER: &str = "x-codex-parent-thread-id";
|
||||
pub const X_CODEX_WINDOW_ID_HEADER: &str = "x-codex-window-id";
|
||||
pub const X_OPENAI_MEMGEN_REQUEST_HEADER: &str = "x-openai-memgen-request";
|
||||
pub const X_OPENAI_SUBAGENT_HEADER: &str = "x-openai-subagent";
|
||||
pub const X_RESPONSESAPI_INCLUDE_TIMING_METRICS_HEADER: &str =
|
||||
"x-responsesapi-include-timing-metrics";
|
||||
@@ -572,6 +573,15 @@ impl ModelClient {
|
||||
{
|
||||
extra_headers.insert(X_OPENAI_SUBAGENT_HEADER, val);
|
||||
}
|
||||
if matches!(
|
||||
self.state.session_source,
|
||||
SessionSource::SubAgent(SubAgentSource::MemoryConsolidation)
|
||||
) {
|
||||
extra_headers.insert(
|
||||
X_OPENAI_MEMGEN_REQUEST_HEADER,
|
||||
HeaderValue::from_static("true"),
|
||||
);
|
||||
}
|
||||
extra_headers
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user