From 2caaae5863c2fd31803a6d944ced4b8b0a7b5e36 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 16 Aug 2025 15:56:38 +0300 Subject: llm/openai: log full message and response content without truncation; keep cyan/green coloring and base black/grey styling --- internal/llm/openai.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/llm/openai.go b/internal/llm/openai.go index a5d473c..45cb1b8 100644 --- a/internal/llm/openai.go +++ b/internal/llm/openai.go @@ -95,8 +95,8 @@ func (c *openAIClient) Chat(ctx context.Context, messages []Message, opts ...Req start := time.Now() c.logf("chat start model=%s temp=%.2f max_tokens=%d stop=%d messages=%d", o.Model, o.Temperature, o.MaxTokens, len(o.Stop), len(messages)) for i, m := range messages { - // Sending context (cyan) - c.logf("msg[%d] role=%s size=%d preview=%s%s%s", i, m.Role, len(m.Content), ansiCyan, trimPreview(m.Content, 200), ansiNormal) + // Sending context (cyan) — log full content with real newlines + c.logf("msg[%d] role=%s size=%d preview=%s%s%s", i, m.Role, len(m.Content), ansiCyan, m.Content, ansiNormal) } req := oaChatRequest{Model: o.Model} req.Messages = make([]oaMessage, len(messages)) @@ -154,8 +154,8 @@ func (c *openAIClient) Chat(ctx context.Context, messages []Message, opts ...Req return "", errors.New("openai: no choices returned") } content := out.Choices[0].Message.Content - // Received context (green) - c.logf("success choice=0 finish=%s size=%d preview=%s%s%s duration=%s", out.Choices[0].FinishReason, len(content), ansiGreen, trimPreview(content, 200), ansiNormal, time.Since(start)) + // Received context (green) — log full content with real newlines + c.logf("success choice=0 finish=%s size=%d preview=%s%s%s duration=%s", out.Choices[0].FinishReason, len(content), ansiGreen, content, ansiNormal, time.Since(start)) return content, nil } -- cgit v1.2.3