Skip to content

fix: inject online human users into agentsMap for sidebar display#148

Merged
khaliqgant merged 1 commit intomainfrom
fix/human-dm-sidebar
Jan 11, 2026
Merged

fix: inject online human users into agentsMap for sidebar display#148
khaliqgant merged 1 commit intomainfrom
fix/human-dm-sidebar

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

  • Bug: Human users were not appearing in the sidebar for DM conversations
  • Cause: Users connecting via dashboard WebSocket were tracked in onlineUsers for presence, but not injected into agentsMap in getAllData()
  • Fix: Inject online human users into agentsMap with cli: 'dashboard' so they appear in the users array sent via WebSocket

Root Cause

The getAllData() function builds agentsMap only from file-based config (team.json or agents.json). Human users registered via userBridge.registerUser() were added to the presence system but never made it into the WebSocket data, so data?.users was always empty.

Changes

  1. Added avatarUrl to AgentStatus interface
  2. After loading agents from config, inject online human users from onlineUsers map with:
    • cli: 'dashboard' (marks them as human users)
    • status: 'online'
    • role: 'User'

Test plan

  • Connect as a human user to the dashboard
  • Verify human users appear in the sidebar "Team" section
  • Click on a human user to open DM
  • Verify agent invite buttons appear in DM header
  • Invite an agent to the DM and verify messages work

🤖 Generated with Claude Code

Human users connecting via the dashboard WebSocket were being tracked
in onlineUsers for presence but not being included in the agents data
sent via WebSocket. This caused humans to not appear in the sidebar
for DM conversations.

The fix injects online human users into agentsMap with cli: 'dashboard'
so they appear in the users array and show up in the sidebar.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@my-senior-dev-pr-review
Copy link
Copy Markdown

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

⚡ 8th PR this month

View your contributor analytics →


📊 1 file reviewed • 4 need attention

⚠️ Needs Attention:

  • src/dashboard-server/server.ts — Changes to user data handling and visibility could introduce logical integrity issues and need thorough review before merging.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

@khaliqgant khaliqgant merged commit ca0c8d1 into main Jan 11, 2026
6 checks passed
@khaliqgant khaliqgant deleted the fix/human-dm-sidebar branch January 11, 2026 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant