Skip LastAgent in Result JSON serialization

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>
This commit is contained in:
Aurélien Sibiril
2026-04-26 16:31:34 +02:00
parent e5b354c3b4
commit 119638deda

View File

@@ -21,7 +21,7 @@ type (
Messages []llm.Message
Usage llm.Usage
Turns int
LastAgent *Agent
LastAgent *Agent `json:"-"`
}
)