From 13f4c36aebe7890b956c5822667253bdc62bead3 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Thu, 28 May 2026 10:38:10 +0300 Subject: [PATCH] chore(helexa-acp): log outgoing chat-completion body at debug level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Useful for diagnosing "the model isn't using tools" — confirming that helexa-acp is in fact sending the `tools` array (and what messages, system prompt, etc. accompany it) without having to attach a packet capture upstream of cortex. Co-Authored-By: Claude Opus 4.7 (1M context) --- crates/helexa-acp/src/provider/openai_chat.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/helexa-acp/src/provider/openai_chat.rs b/crates/helexa-acp/src/provider/openai_chat.rs index 53271bb..0102f6e 100644 --- a/crates/helexa-acp/src/provider/openai_chat.rs +++ b/crates/helexa-acp/src/provider/openai_chat.rs @@ -96,6 +96,16 @@ impl Provider for OpenAIChatProvider { cancel: CancellationToken, ) -> anyhow::Result>> { let body = encode_request(&request); + // Diagnostics for "the model isn't using tools" issues: + // at debug level we log the full body so an operator can + // confirm `tools` is in the request and inspect message + // shapes. Stays at debug because chat history can be large. + tracing::debug!( + endpoint = %self.endpoint.name, + url = %self.endpoint.chat_completions_url(), + body = %serde_json::to_string(&body).unwrap_or_else(|_| "".into()), + "POST /chat/completions" + ); let mut req = self .http .post(self.endpoint.chat_completions_url())