From c220fd0ce751005b675283b5c778d74bf5b8f630 Mon Sep 17 00:00:00 2001 From: "Anderson A. Giacomolli" Date: Fri, 6 Nov 2026 11:33:01 -0300 Subject: [PATCH] Name the reply kind for its role The agent's own replies have the kind reply. Every agent in the tree uses the same kinds, so a kind cannot carry the name of one agent. Issue: beb9a70 --- log.go | 12 ++++++------ log_test.go | 2 +- tree_test.go | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/log.go b/log.go index 22012e2..7b8d512 100644 --- a/log.go +++ b/log.go @@ -17,12 +17,12 @@ var errLocked = errors.New("another process owns the chat") // kinds holds the kinds that a message can have. var kinds = map[string]bool{ - "user": true, - "unii": true, - "tool": true, - "echo": true, - "work": true, - "note": true, + "user": true, + "reply": true, + "tool": true, + "echo": true, + "work": true, + "note": true, } // Message is one entry of the chat log. ID is the permanent position of the diff --git a/log_test.go b/log_test.go index 83e2aca..f3218a9 100644 --- a/log_test.go +++ b/log_test.go @@ -16,7 +16,7 @@ func TestLogReopenLoadsTheSameMessages(t *testing.T) { require.NoError(t, err) var written []Message - for _, kind := range []string{"user", "unii", "tool", "echo", "work", "note"} { + for _, kind := range []string{"user", "reply", "tool", "echo", "work", "note"} { message, err := log.Append(kind, kind+" text ✓") require.NoError(t, err) diff --git a/tree_test.go b/tree_test.go index 3188f10..2e7ff3a 100644 --- a/tree_test.go +++ b/tree_test.go @@ -55,7 +55,7 @@ func TestTreeBuildsEachNodeOnce(t *testing.T) { require.ErrorContains(t, tree.Add(testNode(0, 0, "user: b")), "already built") require.ErrorContains(t, tree.Add(testNode(1, 0, "a b")), "child that is not built") - require.NoError(t, tree.Add(testNode(0, 1, "unii: b"))) + require.NoError(t, tree.Add(testNode(0, 1, "reply: b"))) require.NoError(t, tree.Add(testNode(1, 0, "a b"))) node, built := tree.Node(0, 0) @@ -70,9 +70,9 @@ func TestTreeReopenLoadsTheSameNodes(t *testing.T) { require.NoError(t, err) nodes := []Node{ - testNode(0, 1, "unii: b"), + testNode(0, 1, "reply: b"), testNode(0, 0, "user: a"), - testNode(1, 0, "user: a\nunii: b"), + testNode(1, 0, "user: a\nreply: b"), } for _, node := range nodes { require.NoError(t, tree.Add(node)) @@ -82,7 +82,7 @@ func TestTreeReopenLoadsTheSameNodes(t *testing.T) { data, err := os.ReadFile(filepath.Join(root, "tree", "2026-01-01.jsonl")) require.NoError(t, err) - require.Equal(t, `{"l":0,"i":1,"text":"unii: b","size":7}`+"\n", strings.SplitAfter(string(data), "\n")[0]) + require.Equal(t, `{"l":0,"i":1,"text":"reply: b","size":8}`+"\n", strings.SplitAfter(string(data), "\n")[0]) tree, err = openTree(t.Context(), root, 2, clock.Now) require.NoError(t, err) -- 2.53.0