Files
picoclaw/pkg/agent/sqlite_test_path_test.go
T
loveuer b8b11d452f feat: store PicoClaw memory in SQLite
Store session history, preferences, and dated records in one database per home.
Commit complete turns, checkpoint tool batches, and compact history by prefix.
Add memory search and writes, with previews for ambiguous corrections.
Review conversations in the background and support SQLite backup and restore.
2026-11-25 11:36:10 +08:00

24 lines
495 B
Go

package agent
import (
"crypto/sha256"
"fmt"
"os"
"path/filepath"
"testing"
)
func TestMain(m *testing.M) {
// Tests can construct independent agents in one process with reused keys.
dir, err := os.MkdirTemp("", "picoclaw-agent-db-tests-")
if err != nil {
panic(err)
}
memoryDatabasePath = func(workspace string) string {
return filepath.Join(dir, fmt.Sprintf("%x", sha256.Sum256([]byte(workspace))), "memory.sqlite3")
}
code := m.Run()
_ = os.RemoveAll(dir)
os.Exit(code)
}