| 1 | diff --git a/internal/daemon/mcp_test.go b/internal/daemon/mcp_test.go |
| 2 | index 6e2048f..9d5e799 100644 |
| 3 | --- a/internal/daemon/mcp_test.go |
| 4 | +++ b/internal/daemon/mcp_test.go |
| 5 | @@ -334,8 +334,16 @@ func TestMCPRoomWikiAndAgentTools(t *testing.T) { |
| 6 | t.Fatalf("post_message without room: %s", text(result)) |
| 7 | } |
| 8 | result, isError = call("read_room", map[string]any{"id": "general"}, "") |
| 9 | - messages, _ := structured(result)["messages"].([]any) |
| 10 | - if isError || len(messages) != 1 || messages[0].(map[string]any)["id"] != messageID { |
| 11 | + // The relay's own member notices (kind 44100) join the list whenever the |
| 12 | + // room projection has run, so count chat messages only. |
| 13 | + var chat []map[string]any |
| 14 | + items, _ := structured(result)["messages"].([]any) |
| 15 | + for _, item := range items { |
| 16 | + if m, _ := item.(map[string]any); m["kind"] == float64(9) { |
| 17 | + chat = append(chat, m) |
| 18 | + } |
| 19 | + } |
| 20 | + if isError || len(chat) != 1 || chat[0]["id"] != messageID { |
| 21 | t.Fatalf("read_room: %s", text(result)) |
| 22 | } |
| 23 | result, isError = call("reply_in_thread", map[string]any{"room": "general", "root": messageID, "root_pubkey": member, "content": "and back"}, "") |