]> git.giacomolli.uk - onechat/blob - daemon_agent_helper_test.go
Import WhatsApp history into a child
[onechat] / daemon_agent_helper_test.go
1 package main
2
3 import (
4         "path/filepath"
5         "strings"
6         "testing"
7
8         "github.com/stretchr/testify/require"
9 )
10
11 // daemonChildConfig writes a complete child config in its own directory.
12 func daemonChildConfig(t *testing.T, dir, name string) string {
13         t.Helper()
14
15         root, err := openAgent(filepath.Join(dir, daemonAgentDirName))
16         require.NoError(t, err)
17
18         path := filepath.Join(root.dir, "children", name)
19         child, err := openAgent(path)
20         require.NoError(t, err)
21
22         config := child.config
23         config.Name = name
24         config.Model = "gpt-test-" + strings.ToLower(name)
25         config.Effort = "high"
26         config.Parent = root.config.Name
27         config.Responsibility = "Keep the plans and decisions for " + name + "."
28         config.Workdir = dir
29         agentWriteTestConfig(t, path, config)
30
31         return path
32 }