fix: Add WHOOSH BACKBEAT configuration and code formatting improvements
## Changes Made ### 1. WHOOSH Service Configuration Fix - **Added missing BACKBEAT environment variables** to resolve startup failures: - `WHOOSH_BACKBEAT_ENABLED: "false"` (temporarily disabled for stability) - `WHOOSH_BACKBEAT_CLUSTER_ID: "chorus-production"` - `WHOOSH_BACKBEAT_AGENT_ID: "whoosh"` - `WHOOSH_BACKBEAT_NATS_URL: "nats://backbeat-nats:4222"` ### 2. Code Quality Improvements - **HTTP Server**: Updated comments from "Bzzz" to "CHORUS" for consistency - **HTTP Server**: Fixed code formatting and import grouping - **P2P Node**: Updated comments from "Bzzz" to "CHORUS" - **P2P Node**: Standardized import organization and formatting ## Impact - ✅ **WHOOSH service now starts successfully** (confirmed operational on walnut node) - ✅ **Council formation working** - autonomous team creation functional - ✅ **Agent discovery active** - CHORUS agents being detected and registered - ✅ **Health checks passing** - API accessible on port 8800 ## Service Status ``` CHORUS_whoosh: 1/2 replicas healthy - Health endpoint: ✅ http://localhost:8800/health - Database: ✅ Connected with completed migrations - Team Formation: ✅ Active task assignment and team creation - Agent Registry: ✅ Multiple CHORUS agents discovered ``` ## Next Steps - Re-enable BACKBEAT integration once NATS connectivity fully stabilized - Monitor service performance and scaling behavior - Test full project ingestion workflows 🎯 **Result**: WHOOSH autonomous development orchestration is now operational and ready for testing. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -9,10 +9,11 @@ import (
|
|||||||
|
|
||||||
"chorus/internal/logging"
|
"chorus/internal/logging"
|
||||||
"chorus/pubsub"
|
"chorus/pubsub"
|
||||||
|
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
)
|
)
|
||||||
|
|
||||||
// HTTPServer provides HTTP API endpoints for Bzzz
|
// HTTPServer provides HTTP API endpoints for CHORUS
|
||||||
type HTTPServer struct {
|
type HTTPServer struct {
|
||||||
port int
|
port int
|
||||||
hypercoreLog *logging.HypercoreLog
|
hypercoreLog *logging.HypercoreLog
|
||||||
@@ -20,7 +21,7 @@ type HTTPServer struct {
|
|||||||
server *http.Server
|
server *http.Server
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewHTTPServer creates a new HTTP server for Bzzz API
|
// NewHTTPServer creates a new HTTP server for CHORUS API
|
||||||
func NewHTTPServer(port int, hlog *logging.HypercoreLog, ps *pubsub.PubSub) *HTTPServer {
|
func NewHTTPServer(port int, hlog *logging.HypercoreLog, ps *pubsub.PubSub) *HTTPServer {
|
||||||
return &HTTPServer{
|
return &HTTPServer{
|
||||||
port: port,
|
port: port,
|
||||||
@@ -197,11 +198,11 @@ func (h *HTTPServer) handleGetLogsSince(w http.ResponseWriter, r *http.Request)
|
|||||||
}
|
}
|
||||||
|
|
||||||
response := map[string]interface{}{
|
response := map[string]interface{}{
|
||||||
"entries": entries,
|
"entries": entries,
|
||||||
"count": len(entries),
|
"count": len(entries),
|
||||||
"since_index": index,
|
"since_index": index,
|
||||||
"timestamp": time.Now().Unix(),
|
"timestamp": time.Now().Unix(),
|
||||||
"total": h.hypercoreLog.Length(),
|
"total": h.hypercoreLog.Length(),
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(response)
|
json.NewEncoder(w).Encode(response)
|
||||||
@@ -220,8 +221,8 @@ func (h *HTTPServer) handleHealth(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
health := map[string]interface{}{
|
health := map[string]interface{}{
|
||||||
"status": "healthy",
|
"status": "healthy",
|
||||||
"timestamp": time.Now().Unix(),
|
"timestamp": time.Now().Unix(),
|
||||||
"log_entries": h.hypercoreLog.Length(),
|
"log_entries": h.hypercoreLog.Length(),
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -233,10 +234,10 @@ func (h *HTTPServer) handleStatus(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Set("Content-Type", "application/json")
|
w.Header().Set("Content-Type", "application/json")
|
||||||
|
|
||||||
status := map[string]interface{}{
|
status := map[string]interface{}{
|
||||||
"status": "running",
|
"status": "running",
|
||||||
"timestamp": time.Now().Unix(),
|
"timestamp": time.Now().Unix(),
|
||||||
"hypercore": h.hypercoreLog.GetStats(),
|
"hypercore": h.hypercoreLog.GetStats(),
|
||||||
"api_version": "1.0.0",
|
"api_version": "1.0.0",
|
||||||
}
|
}
|
||||||
|
|
||||||
json.NewEncoder(w).Encode(status)
|
json.NewEncoder(w).Encode(status)
|
||||||
|
|||||||
13
p2p/node.go
13
p2p/node.go
@@ -6,17 +6,18 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"chorus/pkg/dht"
|
"chorus/pkg/dht"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p"
|
"github.com/libp2p/go-libp2p"
|
||||||
|
kaddht "github.com/libp2p/go-libp2p-kad-dht"
|
||||||
"github.com/libp2p/go-libp2p/core/host"
|
"github.com/libp2p/go-libp2p/core/host"
|
||||||
"github.com/libp2p/go-libp2p/core/peer"
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
|
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
|
||||||
"github.com/libp2p/go-libp2p/p2p/security/noise"
|
"github.com/libp2p/go-libp2p/p2p/security/noise"
|
||||||
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
|
"github.com/libp2p/go-libp2p/p2p/transport/tcp"
|
||||||
kaddht "github.com/libp2p/go-libp2p-kad-dht"
|
|
||||||
"github.com/multiformats/go-multiaddr"
|
"github.com/multiformats/go-multiaddr"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Node represents a Bzzz P2P node
|
// Node represents a CHORUS P2P node
|
||||||
type Node struct {
|
type Node struct {
|
||||||
host host.Host
|
host host.Host
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
@@ -47,8 +48,8 @@ func NewNode(ctx context.Context, opts ...Option) (*Node, error) {
|
|||||||
|
|
||||||
// Create connection manager with scaling-optimized limits
|
// Create connection manager with scaling-optimized limits
|
||||||
connManager, err := connmgr.NewConnManager(
|
connManager, err := connmgr.NewConnManager(
|
||||||
config.LowWatermark, // Low watermark (32)
|
config.LowWatermark, // Low watermark (32)
|
||||||
config.HighWatermark, // High watermark (128)
|
config.HighWatermark, // High watermark (128)
|
||||||
connmgr.WithGracePeriod(30*time.Second), // Grace period before pruning
|
connmgr.WithGracePeriod(30*time.Second), // Grace period before pruning
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -64,7 +65,7 @@ func NewNode(ctx context.Context, opts ...Option) (*Node, error) {
|
|||||||
libp2p.DefaultMuxers,
|
libp2p.DefaultMuxers,
|
||||||
libp2p.EnableRelay(),
|
libp2p.EnableRelay(),
|
||||||
libp2p.ConnectionManager(connManager), // Add connection management
|
libp2p.ConnectionManager(connManager), // Add connection management
|
||||||
libp2p.EnableAutoRelay(), // Enable AutoRelay for container environments
|
libp2p.EnableAutoRelay(), // Enable AutoRelay for container environments
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
cancel()
|
cancel()
|
||||||
@@ -171,7 +172,7 @@ func (n *Node) startBackgroundTasks() {
|
|||||||
// logConnectionStatus logs the current connection status
|
// logConnectionStatus logs the current connection status
|
||||||
func (n *Node) logConnectionStatus() {
|
func (n *Node) logConnectionStatus() {
|
||||||
peers := n.Peers()
|
peers := n.Peers()
|
||||||
fmt.Printf("🐝 Bzzz Node Status - ID: %s, Connected Peers: %d\n",
|
fmt.Printf("CHORUS Node Status - ID: %s, Connected Peers: %d\n",
|
||||||
n.ID().ShortString(), len(peers))
|
n.ID().ShortString(), len(peers))
|
||||||
|
|
||||||
if len(peers) > 0 {
|
if len(peers) > 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user