From 34e73f6b1a749cd5d85a7e08d76490830533b404 Mon Sep 17 00:00:00 2001 From: LiusCraft Date: Mon, 11 May 2026 01:09:22 +0800 Subject: [PATCH] fix(test): read back history after SetHistory to account for CreatedAt normalization --- pkg/agent/agent_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/agent/agent_test.go b/pkg/agent/agent_test.go index fe775656e..29c2b32ea 100644 --- a/pkg/agent/agent_test.go +++ b/pkg/agent/agent_test.go @@ -1062,6 +1062,8 @@ func TestProcessMessage_BtwCommandRunsWithoutPersistingHistory(t *testing.T) { defaultAgent.Sessions.SetHistory(sessionKey, initialHistory) defaultAgent.Sessions.SetSummary(sessionKey, "The team decided to keep state request-scoped.") + initialHistory = defaultAgent.Sessions.GetHistory(sessionKey) + response, err := al.processMessage(context.Background(), msg) if err != nil { t.Fatalf("processMessage() error = %v", err) @@ -1180,6 +1182,8 @@ func TestProcessMessage_BtwCommandUsesIsolatedProvider(t *testing.T) { } defaultAgent.Sessions.SetHistory(mainSessionKey, initialHistory) + initialHistory = defaultAgent.Sessions.GetHistory(mainSessionKey) + // Process a /btw command response, err := al.processMessage(context.Background(), bus.InboundMessage{ Channel: "telegram",