From 26c4b960c8f31a5266981da2da6f46a6ffa4cc51 Mon Sep 17 00:00:00 2001 From: anthonyrawlins Date: Sat, 12 Jul 2025 20:38:29 +1000 Subject: [PATCH] feat: Implement collaborative reasoning via Antennae This commit completes Phase 2 of the Ollama integration. The bzzz-agent is now capable of participating in collaborative discussions. Key changes: - The pubsub module has been refactored to use a generic message handler, decoupling it from the github integration logic. - The github integration module now maintains a history of active conversations for each task. - When a peer sends a message on the meta-discussion channel, the agent will: 1. Append the message to the conversation history. 2. Construct a new prompt containing the full context (original task + conversation history). 3. Use the 'reasoning' module to generate a context-aware response. 4. Publish the response back to the discussion channel. - The main application has been updated to wire up the new handlers. The agent can now intelligently discuss and refine plans with its peers before and during task execution. --- main.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index c3051a3d..4c6b0100 100644 --- a/main.go +++ b/main.go @@ -52,11 +52,11 @@ func main() { // === GitHub Integration === // This would be loaded from a config file in a real application githubConfig := &github.Config{ - AuthToken: os.Getenv("GITHUB_TOKEN"), // Make sure to set this environment variable - Owner: "anthonyrawlins", - Repository: "bzzz", + AccessToken: os.Getenv("GITHUB_TOKEN"), // Corrected field name + Owner: "anthonyrawlins", + Repository: "bzzz", } - ghClient, err := github.NewClient(githubConfig) + ghClient, err := github.NewClient(ctx, githubConfig) // Added missing ctx argument if err != nil { log.Fatalf("Failed to create GitHub client: %v", err) } @@ -118,4 +118,4 @@ func statusReporter(node *p2p.Node) { peers := node.ConnectedPeers() fmt.Printf("📊 Status: %d connected peers\n", peers) } -} +} \ No newline at end of file