X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/80e348724041a694002fc38f57e8868b9b9a2be9..c781f79f3c8cb9a7577ee1574d196988da2719b3:/daemon_children_test.go diff --git a/daemon_children_test.go b/daemon_children_test.go index b9e212f..b377b4d 100644 --- a/daemon_children_test.go +++ b/daemon_children_test.go @@ -49,6 +49,7 @@ func TestDaemonToolsCreateAndTellAChildDuringATurn(t *testing.T) { modelWriteEvents(w, modelCompletedEvent(items, 100, 0, 5)) } + whatsapp, _, _ := whatsappStartTest(t, dir, newTestClock()) listener, err := daemonListenSocket(filepath.Join(dir, socketFileName)) require.NoError(t, err) @@ -111,6 +112,7 @@ func TestChildCreationRefusesUsedNames(t *testing.T) { test.root.runs.subagents.draw = func() string { return "BlueFox" } + subagent, err := test.root.runs.subagents.Create(t.Context()) require.NoError(t, err) require.Equal(t, "BlueFox", subagent.name) @@ -145,6 +147,7 @@ func TestChildCreationAcceptsAreaNames(t *testing.T) { child: "A" + strings.Repeat("b", 31), }, } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { test := newDaemonChildrenTest(t) @@ -209,6 +212,7 @@ func TestChildCreationRefusesInvalidAreaNames(t *testing.T) { child: "Hous\u00e9", }, } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { test := newDaemonChildrenTest(t) @@ -320,6 +324,7 @@ func TestChildNamesStayOutOfSubagentDraws(t *testing.T) { return name } + subagent, err := test.root.runs.subagents.Create(t.Context()) require.NoError(t, err) require.Equal(t, "BlueFox", subagent.name) @@ -364,6 +369,7 @@ func TestZoomReadsTheChildViewAndKeepsSubagentLogs(t *testing.T) { test.root.runs.subagents.draw = func() string { return "BlueFox" } + subagent, err := test.root.runs.subagents.Create(t.Context()) require.NoError(t, err) @@ -439,6 +445,7 @@ func newDaemonChildrenTest(t *testing.T) *DaemonChildrenTest { test := &DaemonChildrenTest{ server: newModelFake(t), } + agents, err := openDaemonAgents(t.Context(), t.TempDir(), test.server.URL, ModelAPIKey(modelTestKey), defaultConfig().Compactor, time.Now, discardLog()) require.NoError(t, err) @@ -457,6 +464,7 @@ func newDaemonChildrenTest(t *testing.T) *DaemonChildrenTest { root: test.root, messages: messages, } + test.root.tools.children = test.runtime t.Cleanup(func() { cancel()