From 119638dedaf51298552eb4b4d7f4d74082584051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Sibiril?= <81782+aureliensibiril@users.noreply.github.com> Date: Sun, 26 Apr 2026 16:31:34 +0200 Subject: [PATCH] Skip LastAgent in Result JSON serialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Result.LastAgent is *Agent, which holds only unexported fields. The default json.Marshal renders it as an empty object, which is misleading when persisted alongside the agent run. Tag LastAgent as json:"-" and add explicit lowercase JSON tags to the remaining fields so the serialized shape is stable for callers that read the persisted result column. Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com> --- pkg/agent/result.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agent/result.go b/pkg/agent/result.go index b7acf0d3c..2052e2684 100644 --- a/pkg/agent/result.go +++ b/pkg/agent/result.go @@ -21,7 +21,7 @@ type ( Messages []llm.Message Usage llm.Usage Turns int - LastAgent *Agent + LastAgent *Agent `json:"-"` } )