From 77491b4a6976178fef0421c041d7e41fbc5dfe53 Mon Sep 17 00:00:00 2001 From: Salman Paracha Date: Sun, 24 Aug 2025 14:11:21 -0700 Subject: [PATCH] adding some debug logs to help --- crates/prompt_gateway/src/stream_context.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/prompt_gateway/src/stream_context.rs b/crates/prompt_gateway/src/stream_context.rs index 96caa378..768e6780 100644 --- a/crates/prompt_gateway/src/stream_context.rs +++ b/crates/prompt_gateway/src/stream_context.rs @@ -129,6 +129,9 @@ impl StreamContext { body: Vec, mut callout_context: StreamCallContext, ) { + // Debug: print raw bytes in hex to diagnose extra data + debug!("raw upstream response bytes (hex): {}", + body.iter().map(|b| format!("{:02x}", b)).collect::>().join(" ")); let body_str = String::from_utf8(body).unwrap(); info!("on_http_call_response: model server response received"); debug!("response body: {}", body_str); @@ -662,6 +665,9 @@ impl StreamContext { } pub fn default_target_handler(&self, body: Vec, mut callout_context: StreamCallContext) { + // Debug: print raw bytes in hex to diagnose extra data + debug!("raw upstream response bytes (hex): {}", + body.iter().map(|b| format!("{:02x}", b)).collect::>().join(" ")); let prompt_target = self .prompt_targets .get(callout_context.prompt_target_name.as_ref().unwrap())