Skip to content

feat(discord): add channel history tool#10736

Closed
zhouminmin0411-hub wants to merge 1 commit into
NousResearch:mainfrom
zhouminmin0411-hub:codex/discord-history-feature
Closed

feat(discord): add channel history tool#10736
zhouminmin0411-hub wants to merge 1 commit into
NousResearch:mainfrom
zhouminmin0411-hub:codex/discord-history-feature

Conversation

@zhouminmin0411-hub

Copy link
Copy Markdown

Summary

  • add a builtin tool for reading recent messages from the current Discord channel or thread
  • expose a Discord REST helper that returns normalized message history including author, content, timestamp, message_id, and bot authors
  • cover the new tool and REST normalization paths with tests

Why

Hermes can already send messages in Discord, but it cannot inspect the recent channel context on demand. This blocks instructions like look at the message Trouble sent above unless the user manually forwards the content.

This change adds a bounded read-history capability so Discord sessions can reference recent channel context directly.

Testing

  • pytest -q tests/tools/test_discord_channel_history_tool.py tests/gateway/test_discord_history_api.py tests/hermes_cli/test_tools_config.py
  • live smoke test against a real Discord channel, confirming the tool returned the latest 20 messages including bot messages

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have platform/discord Discord bot adapter comp/tools Tool registry, model_tools, toolsets labels Apr 25, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the contribution @zhouminmin0411-hub! This is an automated hermes-sweeper review.

The channel-history read capability you're adding here was implemented on main before this PR could be merged. Specifically, commit 81987f035 (merged 2026-04-24) added fetch_messages as a core action in tools/discord_tool.py and auto-wired it into the discord toolset:

  • tools/discord_tool.py lines 347–383_fetch_messages() fetches recent channel messages via Discord REST, normalizing id, content, author (including bot flag), timestamp, attachments, and reactions.
  • Line 476fetch_messages is in _CORE_ACTION_NAMES, so it is auto-enabled for all Discord sessions without requiring hermes tools opt-in.
  • 81987f035 — the commit message explicitly calls out fetch_messages as one of the three core actions in the new discord toolset split.

The separate discord_channel_history_tool.py file this PR proposes would duplicate that existing functionality. Closing as implemented on main.

@teknium1 teknium1 closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants