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>
This commit is contained in:
Max Brunsfeldandzed-zippy[bot] authored and GitHub committed 2026-08-12 19:27:06 +00:00
1 parent 8a52ec4b66
commit efc1a47014
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -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}");
@@ -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)