Skip to content

feat(discord): include channel name in message metadata#1466

Closed
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:feat/discord-channel-name-context
Closed

feat(discord): include channel name in message metadata#1466
darrenzeng2025 wants to merge 1 commit intosipeed:mainfrom
darrenzeng2025:feat/discord-channel-name-context

Conversation

@darrenzeng2025
Copy link
Copy Markdown
Contributor

Description

Add Discord channel name to message metadata for better agent context.

Currently, the dynamic context shows only the numeric Discord channel ID which provides no semantic context to the LLM. This change adds the human-readable channel name so the agent knows whether it's talking in #general, #support, or #off-topic.

Changes

  • Added channel_name to metadata map in Discord channel handler
  • Uses s.State.Channel() for zero-cost lookup from cache
  • Graceful fallback if channel name is not available

Type of Change

  • Enhancement (non-breaking improvement to existing functionality)

AI Code Generation

🤖 Fully AI-generated - AI wrote the code; contributor reviewed and validated it

Related Issue

Fixes #1451

Technical Context

Per the issue description, the channel name is retrieved using s.State.Channel(m.ChannelID) which is populated on connect and is a zero-cost lookup in the common case.

The metadata flows through bus.InboundMessage.Metadata to the agent loop where it can be used for context building.

Test Environment

  • OS: Linux
  • Go version: 1.17+

Checklist

  • I have read and understood the contribution guidelines
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Add Discord channel name to metadata map when processing messages.
This provides better context for the agent by including the human-readable
channel name alongside the numeric channel ID.

The channel name is retrieved from Discord's state cache (zero-cost lookup
in common case) with graceful handling if not available.

Fixes sipeed#1451
@sipeed-bot sipeed-bot bot added type: enhancement New feature or request domain: channel go Pull requests that update go code labels Mar 13, 2026
xuwei-xy pushed a commit to xuwei-xy/picoclaw that referenced this pull request Mar 14, 2026
@sipeed-bot
Copy link
Copy Markdown

sipeed-bot bot commented Mar 28, 2026

@darrenzeng2025 Hi! This PR has had no activity for over 2 weeks, so I'm closing it for now to keep things tidy. If it's still relevant, feel free to reopen it anytime and we'll pick it back up.

@sipeed-bot sipeed-bot bot closed this Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: channel go Pull requests that update go code type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Include Discord channel name in agent dynamic context

1 participant