From efc1a4701480bad40d69c309fc71507f6da17348 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 12 Aug 2026 19:27:06 +0000 Subject: [PATCH] openai_subscribed: Log compaction response errors (#62540) ChatGPT subscription compaction failures currently flow through the generic HTTP status conversion before callers can inspect the provider response. A 404 therefore becomes `ApiEndpointNotFound`, which drops the response body and leaves logs with only the inferred endpoint-not-found message. Log the original `RequestError` at the subscription compaction call site before returning it unchanged. The log identifies the compact endpoint and preserves the HTTP status and response body for diagnosis, without logging credentials, request contents, or response headers. Error classification, retry behavior, and user-facing presentation remain unchanged. Testing: - `cargo fmt --all --check` - `cargo nextest run -p openai_subscribed --lib` Release Notes: - N/A --------- Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com> --- crates/inspector_ui/src/div_inspector.rs | 2 +- crates/openai_subscribed/src/openai_subscribed.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/inspector_ui/src/div_inspector.rs b/crates/inspector_ui/src/div_inspector.rs index f0415d204c..b78df2254e 100644 --- a/crates/inspector_ui/src/div_inspector.rs +++ b/crates/inspector_ui/src/div_inspector.rs @@ -623,7 +623,7 @@ fn guess_rust_code_from_style(goal_style: &StyleRefinement) -> (String, StyleRef let before_change = style.clone(); style = method.invoke(style); if before_change != style { - let _ = write!(code, "\n .{}()", &method.name); + let _ = write!(code, "\n .{}()", method.name); } } code.push_str("\n}"); diff --git a/crates/openai_subscribed/src/openai_subscribed.rs b/crates/openai_subscribed/src/openai_subscribed.rs index c6464a5bf9..164d5bd126 100644 --- a/crates/openai_subscribed/src/openai_subscribed.rs +++ b/crates/openai_subscribed/src/openai_subscribed.rs @@ -497,7 +497,13 @@ impl LanguageModel for OpenAiSubscribedLanguageModel { compact_request, &extra_headers, ) - .await?; + .await + .inspect_err(|error| { + log::error!( + "ChatGPT subscription compaction request to \ + {CODEX_BASE_URL}/responses/compact failed: {error}" + ); + })?; let usage = token_usage_from_response_usage(&response.usage); let context = response .into_compacted_context(PROVIDER_ID)