Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

openai_subscribed: Log compaction response errors (#62540)

Max Brunsfeldba0e2a94295c
diff --git a/crates/inspector_ui/src/div_inspector.rs b/crates/inspector_ui/src/div_inspector.rs
index f0415d204c9..b78df2254e8 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 c6464a5bf95..164d5bd1265 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)