Disable storage for Azure Responses requests (#38060)

## What changed

- Set `store` to `false` for every Responses request, including requests sent
  through Azure providers.
- Remove the provider-specific storage check and simplify request construction.
- Update the Azure request test to verify that storage is disabled while
  prefixed item IDs remain unchanged.

GitOrigin-RevId: 1c71cb80880058cb26789112f03269b73f0645b9
This commit is contained in:
Eric Traut
2026-08-11 19:35:05 +00:00
committed by copyberry
parent 3a6f747d77
commit 46c3268542
3 changed files with 3 additions and 12 deletions
-4
View File
@@ -85,10 +85,6 @@ impl Provider {
}
}
pub fn is_azure_responses_endpoint(&self) -> bool {
is_azure_responses_provider(&self.name, Some(&self.base_url))
}
pub fn websocket_url_for_path(&self, path: &str) -> Result<Url, url::ParseError> {
let mut url = Url::parse(&self.url_for_path(path))?;
+1 -6
View File
@@ -577,7 +577,6 @@ impl ModelClient {
self.state.auth_env_telemetry.clone(),
);
let request = self.build_responses_request(
&client_setup.api_provider,
prompt,
model_info,
settings.effort,
@@ -842,10 +841,8 @@ impl ModelClient {
}
}
#[allow(clippy::too_many_arguments)]
fn build_responses_request(
&self,
provider: &codex_api::Provider,
prompt: &Prompt,
model_info: &ModelInfo,
effort: Option<ReasoningEffortConfig>,
@@ -931,7 +928,7 @@ impl ModelClient {
tool_choice: "auto".to_string(),
parallel_tool_calls: prompt.parallel_tool_calls && !model_info.use_responses_lite,
reasoning: Some(reasoning),
store: provider.is_azure_responses_endpoint(),
store: false,
stream: true,
stream_options,
include,
@@ -1482,7 +1479,6 @@ impl ModelClientSession {
.await;
let mut request = self.client.build_responses_request(
&client_setup.api_provider,
prompt,
model_info,
effort.clone(),
@@ -1603,7 +1599,6 @@ impl ModelClientSession {
pending_retry,
);
let mut request = self.client.build_responses_request(
&client_setup.api_provider,
prompt,
model_info,
effort.clone(),
+2 -2
View File
@@ -3028,7 +3028,7 @@ async fn includes_developer_instructions_message_in_request() {
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn azure_responses_request_includes_store_and_prefixed_item_ids() {
async fn azure_responses_request_does_not_store_and_preserves_prefixed_item_ids() {
skip_if_no_network!();
let server = MockServer::start().await;
@@ -3222,7 +3222,7 @@ async fn azure_responses_request_includes_store_and_prefixed_item_ids() {
assert_eq!(request.path(), "/openai/responses");
let body = request.body_json();
assert_eq!(body["store"], serde_json::Value::Bool(true));
assert_eq!(body["store"], serde_json::Value::Bool(false));
assert_eq!(body["stream"], serde_json::Value::Bool(true));
assert_eq!(body["input"].as_array().map(Vec::len), Some(10));
assert_eq!(body["input"][0]["id"].as_str(), Some("rs_reasoning-id"));