Skip to content

feat(discord): support renaming existing threads - #63330

Open
liudt921115 wants to merge 6 commits into
NousResearch:mainfrom
liudt921115:feat/discord-edit-thread
Open

feat(discord): support renaming existing threads#63330
liudt921115 wants to merge 6 commits into
NousResearch:mainfrom
liudt921115:feat/discord-edit-thread

Conversation

@liudt921115

Copy link
Copy Markdown

Summary

  • add discord_admin(action="edit_thread")
  • rename an existing Discord thread through the REST API
  • expose the action in the dynamic manifest/schema
  • add request/response regression coverage

Verification

  • ./venv/bin/python -m pytest -q tests/tools/test_discord_tool.py

@alt-glitch alt-glitch added type/feature New feature or request tool/delegate Subagent delegation platform/discord Discord bot adapter duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have labels Jul 12, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #46397 — same mechanism (rename an existing Discord thread via PATCH /channels/{id} in tools/discord_tool.py), only the action name differs (edit_thread here vs rename_thread in #46397). #46397 is the earliest-open canonical implementation. This is a heavily duplicated feature area (see tracking issue #18430).

@webtecnica

Copy link
Copy Markdown
Contributor

Closing as duplicate — this feature was already implemented and merged in #60187 (feat(discord): rename auto-created threads to generated session titles) by @teknium1 on Jul 7, which adds thread renaming with auto-generated session titles through the existing title_callback mechanism. Appreciate the contribution! 🙏

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding a direct thread-renaming primitive. Current main already renames Hermes-created auto-threads after title generation (gateway/run.py:13796-13843), but it does not expose an action for an arbitrary existing thread (tools/discord_tool.py:633-676), so the requested capability is still distinct.

Problems

  • tools/discord_tool.py:620 PATCHes /channels/{channel_id} without first checking the target type. The canonical open implementation in #46397 documents that this endpoint can also rename ordinary channels and guards it by accepting only thread types 10/11/12. This action should not rename a top-level channel when asked to rename a thread.
  • The diff also includes unrelated cron, provider-resolution, gateway-onboarding, and bot-relay work. Those changes are outside the stated Discord tool feature and should not be coupled to it.

Suggested changes

  • GET the target channel first, reject non-thread types with a structured error, and add text-channel/forum rejection tests alongside the successful-thread test.
  • Keep the salvage focused on tools/discord_tool.py and its corresponding tests; split the other changes.

Automated hermes-sweeper review.

Comment thread tools/discord_tool.py
def _edit_thread(token: str, channel_id: str, name: str, **_kwargs: Any) -> str:
"""Rename an existing thread (Discord channel) via the REST API."""
channel = _discord_request(
"PATCH",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This modifies any Discord channel ID, not just a thread. Please GET the target first and accept only thread types 10/11/12 before PATCHing; otherwise an agent asked to rename a thread can rename a top-level text channel.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/discord Discord bot adapter sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-security-boundary Sweeper risk: may affect sandboxing, auth, credentials, or sensitive data tool/delegate Subagent delegation type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants