NousResearch/hermes-agent
Inject Discord channel topic into agent session context
Cluster 163 · gateway. Data as of
1 open item. Fix merged in #248 on 2 Mar 2026. Check it covers your case.
The short answer
1open issue
0open PRs
3items grouped
- Known?
- Yes. 3 related items grouped here, 1 issue already closed.
- Fix event
- A fix was merged to main in PR #248. Check it covers your case. No release data is tracked.
- Tracker
- The maintainers' tracker marks this
partially resolved, deciding PR #248. That is separate from the fix event. - Still open
- 1 issue and 0 PRs.
Next step: read #248, then check whether your report is the one still open.
Read #248Pick up a Lab taskThese issues and pull requests concern adding Discord channel or forum topic/description data to the context available during agent sessions. The work spans gateway and Discord integration layers.
Open issues1
- Issue#40532feat(discord): inject channel topic/description into agent context
Open PRs0
Fixes on record
-
#248 feat(gateway): include Discord channel topic in session context
files:
gateway/platforms/base.py,gateway/platforms/discord.py,gateway/session.pyShow the diff
-
gateway/platforms/base.py@@ -736,9 +736,13 @@ def build_source( chat_type: str = "dm", user_id: Optional[str] = None, user_name: Optional[str] = None, - thread_id: Optional[str] = None + thread_id: Optional[str] = None, + chat_topic: Optional[str] = None, ) -> SessionSource: """Helper to build a SessionSource for this platform.""" + # Normalize empty topic to None + if chat_topic is not None and not chat_topic.strip(): + chat_topic = None return SessionSource( platform=self.platform, chat_id=str(chat_id), @@ -747,6 +751,7 @@ def build_source( user_id=str(user_id) if user_id else None, user_name=user_name, thread_id=str(thread_id) if thread_id else None, + chat_topic=chat_topic.strip() if chat_topic else None, ) @abstractmethod -
gateway/platforms/discord.py@@ -542,6 +542,9 @@ def _build_slash_event(self, interaction: discord.Interaction, text: str) -> Mes chat_name = interaction.channel.name if hasattr(interaction.channel, "guild") and interaction.channel.guild: chat_name = f"{interaction.channel.guild.name} / #{chat_name}" + + # Get channel topic (if available) + chat_topic = getattr(interaction.channel, "topic", None) source = self.build_source( chat_id=str(interaction.channel_id), @@ -549,6 +552,7 @@ def _build_slash_event(self, interaction: discord.Interaction, text: str) -> Mes chat_type=chat_type, user_id=str(interaction.user.id), user_name=interaction.user.display_name, + chat_topic=chat_topic, ) msg_type = MessageType.COMMAND if text.startswith("/") else MessageType.TEXT @@ -661,6 +665,9 @@ async def _handle_message(self, message: DiscordMessage) -> None: if isinstance(message.channel, discord.Thread): thread_id = str(message.channel.id) + # Get channel topic (if available - TextChannels have topics, DMs/threads don't) + chat_topic = getattr(message.channel, "topic", None) + # Build source source = self.build_source( chat_id=str(message.channel.id), @@ -669,6 +676,7 @@ async def _handle_message(self, message: DiscordMessage) -> None: user_id=str(message.author.id), user_name=message.author.display_name, thread_id=thread_id, + chat_topic=chat_topic, ) # Build media URLs -- download image attachments to local cache so the -
gateway/session.py@@ -44,6 +44,7 @@ class SessionSource: user_id: Optional[str] = None user_name: Optional[str] = None thread_id: Optional[str] = None # For forum topics, Discord threads, etc. + chat_topic: Optional[str] = None # Channel topic/description (Discord, Slack) @property def description(self) -> str: @@ -75,6 +76,7 @@ def to_dict(self) -> Dict[str, Any]: "user_id": self.user_id, "user_name": self.user_name, "thread_id": self.thread_id, + "chat_topic": self.chat_topic, } @classmethod @@ -87,6 +89,7 @@ def from_dict(cls, data: Dict[str, Any]) -> "SessionSource": user_id=data.get("user_id"), user_name=data.get("user_name"), thread_id=data.get("thread_id"), + chat_topic=data.get("chat_topic"), ) @classmethod @@ -154,6 +157,10 @@ def build_session_context_prompt(context: SessionContext) -> str: lines.append(f"**Source:** {platform_name} (the machine running this agent)") else: lines.append(f"**Source:** {platform_name} ({context.source.description})") + + # Channel topic (if available - provides context about the channel's purpose) + if context.source.chat_topic: + lines.append(f"**Channel Topic:** {context.source.chat_topic}") # User identity (especially useful for WhatsApp where multiple people DM) if context.source.user_name:
-
Closed issues · 1
- Closed#163Feature Request: Include Discord channel topic in session context
How this cluster was grouped
-
Link evidence (
partly structural links): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text. - Members outside that structural core may belong to a different underlying problem.
-
Pairwise link density
0.45: the share of item pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36.1.00means every pair is linked.
Pick up a Lab task
Check whether a fix covers the open issues here, with your own agent. Bring back evidence for maintainers.
Open the LabAt a glance
- Subsystem
- gateway
- Merged PRs
- #248
- Closed issues
- 1
- Attempts
- 0 PRs closed without merging
- Fix link checked
- 2 Mar 2026. This confirmation is old and may be out of date (a revert or reopen would not have invalidated it here); re-verify.