+// newTestToolbox returns a toolbox with log, an empty chat, and the working
+// directory dir.
+func newTestToolbox(t *testing.T, log ToolLog, dir string) *Toolbox {
+ t.Helper()
+
+ memory, err := openMemory(t.Context(), t.TempDir(), newTestClock().Now, newFakeSummarizer(), discardLog())
+ require.NoError(t, err)
+
+ t.Cleanup(func() {
+ require.NoError(t, memory.Close())
+ })
+
+ return &Toolbox{
+ log: log,
+ chat: memory,
+ subagents: newTestSubagents(t),
+ workdir: dir,
+ }
+}
+