package main import ( "path/filepath" "testing" "github.com/stretchr/testify/require" ) // newTestSubagents returns the subagents of a new agent directory, with random // names, and closes them at the end of the test. func newTestSubagents(t *testing.T) *Subagents { t.Helper() subagents := newSubagents(filepath.Join(t.TempDir(), subagentDirName), newTestClock().Now, subagentNameRandom) t.Cleanup(func() { require.NoError(t, subagents.Close()) }) return subagents }