testing_helpers.go
1 package agent 2 3 import ( 4 "time" 5 6 "github.com/Kocoro-lab/ShanClaw/internal/client" 7 ) 8 9 // SetRunMessagesForTest injects a run-messages snapshot for tests that 10 // exercise downstream code (e.g., the daemon's session checkpoint helper) 11 // without running a full AgentLoop. Not for production use. 12 func SetRunMessagesForTest(a *AgentLoop, msgs []client.Message) { 13 a.runMessages = msgs 14 // Metadata parallels — fill with zero values so indexed access is safe. 15 a.runMsgInjected = make([]bool, len(msgs)) 16 a.runMsgTimestamps = make([]time.Time, len(msgs)) 17 }