{"repo":"NousResearch/hermes-agent","public_id":"163","display_label":"Inject Discord channel topic into agent session context","summary":"These 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.","subsystem":"gateway","counts":{"members":3,"open_issues":1,"open_issues_distinct":1,"open_prs":0,"closed_issues":1,"merged_prs":1,"attempt_prs":0},"landed_fix":{"status":"merged_to_main","basis":"structural","pr":248,"merged_at":"2026-03-02T08:51:25+00:00"},"resolution":{"state":"partially_resolved","by":"pr-248"},"freshness":{"state":"stale","last_verified_at":"2026-03-02T08:51:25+00:00","is_stale":true},"grouping":{"backbone":"STRUCTURAL_PARTIAL","link_density":0.4533333333333333},"fix_edges":[{"issue_number":163,"pr_number":248,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true,"pr_merged_at":"2026-03-02T08:51:25+00:00"}],"members":[{"kind":"issue","number":163,"title":"Feature Request: Include Discord channel topic in session context","url":null,"state":"closed"},{"kind":"issue","number":40532,"title":"feat(discord): inject channel topic/description into agent context","url":null,"state":"open"},{"kind":"pr","number":248,"title":"feat(gateway): include Discord channel topic in session context","url":null,"state":"merged","close_reason":{"category":"merged"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["gateway/platforms/base.py","gateway/platforms/discord.py","gateway/session.py"],"fix_hunks":[{"file":"gateway/platforms/base.py","hunks":["@@ -736,9 +736,13 @@ def build_source(\n         chat_type: str = \"dm\",\n         user_id: Optional[str] = None,\n         user_name: Optional[str] = None,\n-        thread_id: Optional[str] = None\n+        thread_id: Optional[str] = None,\n+        chat_topic: Optional[str] = None,\n     ) -> SessionSource:\n         \"\"\"Helper to build a SessionSource for this platform.\"\"\"\n+        # Normalize empty topic to None\n+        if chat_topic is not None and not chat_topic.strip():\n+            chat_topic = None\n         return SessionSource(\n             platform=self.platform,\n             chat_id=str(chat_id),","@@ -747,6 +751,7 @@ def build_source(\n             user_id=str(user_id) if user_id else None,\n             user_name=user_name,\n             thread_id=str(thread_id) if thread_id else None,\n+            chat_topic=chat_topic.strip() if chat_topic else None,\n         )\n     \n     @abstractmethod"]},{"file":"gateway/platforms/discord.py","hunks":["@@ -542,6 +542,9 @@ def _build_slash_event(self, interaction: discord.Interaction, text: str) -> Mes\n             chat_name = interaction.channel.name\n             if hasattr(interaction.channel, \"guild\") and interaction.channel.guild:\n                 chat_name = f\"{interaction.channel.guild.name} / #{chat_name}\"\n+        \n+        # Get channel topic (if available)\n+        chat_topic = getattr(interaction.channel, \"topic\", None)\n \n         source = self.build_source(\n             chat_id=str(interaction.channel_id),","@@ -549,6 +552,7 @@ def _build_slash_event(self, interaction: discord.Interaction, text: str) -> Mes\n             chat_type=chat_type,\n             user_id=str(interaction.user.id),\n             user_name=interaction.user.display_name,\n+            chat_topic=chat_topic,\n         )\n \n         msg_type = MessageType.COMMAND if text.startswith(\"/\") else MessageType.TEXT","@@ -661,6 +665,9 @@ async def _handle_message(self, message: DiscordMessage) -> None:\n         if isinstance(message.channel, discord.Thread):\n             thread_id = str(message.channel.id)\n         \n+        # Get channel topic (if available - TextChannels have topics, DMs/threads don't)\n+        chat_topic = getattr(message.channel, \"topic\", None)\n+        \n         # Build source\n         source = self.build_source(\n             chat_id=str(message.channel.id),","@@ -669,6 +676,7 @@ async def _handle_message(self, message: DiscordMessage) -> None:\n             user_id=str(message.author.id),\n             user_name=message.author.display_name,\n             thread_id=thread_id,\n+            chat_topic=chat_topic,\n         )\n         \n         # Build media URLs -- download image attachments to local cache so the"]},{"file":"gateway/session.py","hunks":["@@ -44,6 +44,7 @@ class SessionSource:\n     user_id: Optional[str] = None\n     user_name: Optional[str] = None\n     thread_id: Optional[str] = None  # For forum topics, Discord threads, etc.\n+    chat_topic: Optional[str] = None  # Channel topic/description (Discord, Slack)\n     \n     @property\n     def description(self) -> str:","@@ -75,6 +76,7 @@ def to_dict(self) -> Dict[str, Any]:\n             \"user_id\": self.user_id,\n             \"user_name\": self.user_name,\n             \"thread_id\": self.thread_id,\n+            \"chat_topic\": self.chat_topic,\n         }\n     \n     @classmethod","@@ -87,6 +89,7 @@ def from_dict(cls, data: Dict[str, Any]) -> \"SessionSource\":\n             user_id=data.get(\"user_id\"),\n             user_name=data.get(\"user_name\"),\n             thread_id=data.get(\"thread_id\"),\n+            chat_topic=data.get(\"chat_topic\"),\n         )\n     \n     @classmethod","@@ -154,6 +157,10 @@ def build_session_context_prompt(context: SessionContext) -> str:\n         lines.append(f\"**Source:** {platform_name} (the machine running this agent)\")\n     else:\n         lines.append(f\"**Source:** {platform_name} ({context.source.description})\")\n+    \n+    # Channel topic (if available - provides context about the channel's purpose)\n+    if context.source.chat_topic:\n+        lines.append(f\"**Channel Topic:** {context.source.chat_topic}\")\n \n     # User identity (especially useful for WhatsApp where multiple people DM)\n     if context.source.user_name:\n"]}]}],"trust":{"default_tier":"verified","includes_suggested":false}}