diff --git a/pkg/agent/pipeline_setup.go b/pkg/agent/pipeline_setup.go index 9d5033ce..ea05968c 100644 --- a/pkg/agent/pipeline_setup.go +++ b/pkg/agent/pipeline_setup.go @@ -71,7 +71,14 @@ func (p *Pipeline) SetupTurn(ctx context.Context, ts *turnState) (*turnExecution history, messages, fit = trimHistoryToFitContextWindow( history, func(trimmedHistory []providers.Message) []providers.Message { - rebuildPromptReq := promptBuildRequestForTurn(ts, trimmedHistory, summary, ts.userMessage, ts.media, cfg) + rebuildPromptReq := promptBuildRequestForTurn( + ts, + trimmedHistory, + summary, + ts.userMessage, + ts.media, + cfg, + ) rebuildPromptReq.ActiveSkills = append([]string(nil), contextualSkills...) rebuilt := ts.agent.ContextBuilder.BuildMessagesFromPrompt(rebuildPromptReq) return resolveMediaRefs(rebuilt, p.MediaStore, maxMediaSize) diff --git a/pkg/agent/turn_state.go b/pkg/agent/turn_state.go index 3213ff55..5fc4dd40 100644 --- a/pkg/agent/turn_state.go +++ b/pkg/agent/turn_state.go @@ -690,21 +690,6 @@ func (ts *turnState) restoreSession(agent *AgentInstance) error { return agent.Sessions.Save(ts.sessionKey) } -// messagesContentEqual compares two message slices by content only, ignoring CreatedAt. -// JSON roundtrip loses the monotonic clock portion of time.Time, so direct -// reflect.DeepEqual would always differ on messages that roundtripped through -// the JSONL store. -func messagesContentEqual(a, b []providers.Message) bool { - for i := range a { - aCopy, bCopy := a[i], b[i] - aCopy.CreatedAt, bCopy.CreatedAt = nil, nil - if !reflect.DeepEqual(aCopy, bCopy) { - return false - } - } - return true -} - func matchingTurnMessageTail(history, persisted []providers.Message) int { maxMatch := min(len(history), len(persisted)) for size := maxMatch; size > 0; size-- {