spencrmartin c3c031e4e4 fix: prevent duplicate message rendering in collaborative sessions
🔧 MESSAGE DEDUPLICATION: Eliminate double rendering when second user sends messages

## Root Cause Analysis:
Messages from other users were being processed by multiple event handlers:
1. Regular 'message' event handler
2. Goose message detection (heuristic)
3. Session message handler

This caused the same message to appear multiple times in the chat.

## Solution Implementation:

### Enhanced Message Classification:
✅ Added message type flags (isGooseMessage, isSessionMessage)
✅ Use else-if chain to ensure only one handler processes each message
✅ Prevent multiple event emissions for the same message

### Smart Event Routing:
✅ Regular messages: Only emit 'message' if not Goose/session message
✅ Goose messages: Emit 'gooseMessage' + special 'gooseSessionSync' for collaboration
✅ Session messages: Emit 'sessionMessage' for legacy session handling
✅ Structured logging to track which handler processes each message

### Enhanced Matrix Context:
✅ Updated onMessage to support both default and named event listeners
✅ Overloaded function signature for backward compatibility
✅ Support for 'gooseSessionSync' event in useSessionSharing

### Session Sharing Integration:
✅ Added listener for 'gooseSessionSync' events
✅ Proper cleanup for all event listeners
✅ Maintains existing functionality while preventing duplicates

## Technical Flow:
1. Message received → Classify as regular/Goose/session
2. Emit appropriate event(s) → Only one primary handler per message
3. UI renders once → No duplicate message components
4. Collaboration sync → Works via dedicated 'gooseSessionSync' event

## Benefits:
🎯 **No More Duplicates**: Each message renders exactly once
🔄 **Preserved Functionality**: All existing features still work
🦆 **Goose Communication**: Still detects and handles Goose messages
📝 **Session Sync**: Collaborative sessions work without duplicates
🧹 **Clean Logging**: Clear indication of message processing path

Now when a second user sends a message in a collaborative session,
it will appear exactly once with the correct sender avatar! 🦆✨
2025-11-14 11:19:36 -05:00
2025-09-26 23:44:38 -05:00
2025-11-03 02:25:51 -06:00
…
2025-09-26 23:44:38 -05:00
2025-10-03 13:48:53 -04:00

goose

a local, extensible, open source AI agent that automates engineering tasks

Discord CI

🎉 Hacktoberfest 2025 🎉

goose is a participating project in Hacktoberfest 2025! We’re so excited for your contributions, and have created a wide variety of issues so that anyone can contribute. Whether you're a seasoned developer or a first-time open source contributor, there's something for everyone.

To get started:

  1. Read the contributing guide.
  2. Read the code of conduct.
  3. Read the full Responsible AI-Assisted Coding Guide.
  4. Choose a task from this project's Hacktoberfest issues in our Project Hub and follow the instructions. Each issue has the 🏷️ hacktoberfest label.

Have questions? Connecting with us in our Discord community in the #hacktoberfest project channel.


goose is your on-machine AI agent, capable of automating complex development tasks from start to finish. More than just code suggestions, goose can build entire projects from scratch, write and execute code, debug failures, orchestrate workflows, and interact with external APIs - autonomously.

Whether you're prototyping an idea, refining existing code, or managing intricate engineering pipelines, goose adapts to your workflow and executes tasks with precision.

Designed for maximum flexibility, goose works with any LLM and supports multi-model configuration to optimize performance and cost, seamlessly integrates with MCP servers, and is available as both a desktop app as well as CLI - making it the ultimate AI assistant for developers who want to move faster and focus on innovation.

Watch the video

Quick Links

a little goose humor 🦢

Why did the developer choose goose as their AI agent?

Because it always helps them "migrate" their code to production! 🚀

goose around with us

S
Description
an open-source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Readme Apache-2.0 2 GiB
Languages
Rust 63.6%
TypeScript 29.6%
JavaScript 1.7%
Shell 1.6%
Python 1.5%
Other 1.8%