fix(test): read back history after SetHistory to account for CreatedAt normalization

This commit is contained in:
LiusCraft 2026-05-11 01:09:22 +08:00
parent 21b28bebc2
commit 16749110fa

View file

@ -370,6 +370,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)
@ -488,6 +490,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",