From 43d990f8630339d41bb4a4bb2bc2a163c9209eb1 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Tue, 24 Jun 2025 22:22:34 +0800 Subject: [PATCH] fix: ensure extracted thought is not empty before displaying in report --- internal/version/VERSION | 2 +- report.go | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index e2084c6b..4e7a29cf 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2506242108 +v5.0.0-beta-2506242222 diff --git a/report.go b/report.go index 9ab06436..a7aa5fe8 100644 --- a/report.go +++ b/report.go @@ -541,7 +541,7 @@ func (g *HTMLReportGenerator) GenerateReport(outputFile string) error { // Try to parse as JSON to extract thought field var data map[string]interface{} if err := json.Unmarshal([]byte(content), &data); err == nil { - if thought, ok := data["thought"].(string); ok { + if thought, ok := data["thought"].(string); ok && thought != "" { return thought } } @@ -2325,8 +2325,15 @@ const htmlTemplate = ` {{if $planning.Error}}Error: {{$planning.Error}}{{end}} - {{if $planning.Thought}} -
{{$planning.Thought}}
+ {{$extractedThought := extractThought $planning.Content}} + {{if or $planning.Thought $extractedThought}} +
+ {{if $planning.Thought}} + {{$planning.Thought}} + {{else}} + {{$extractedThought}} + {{end}} +
{{end}}