feat(discord): support renaming existing threads - #63330
Conversation
Duplicate of #46397 — same mechanism (rename an existing Discord thread via |
|
Closing as duplicate — this feature was already implemented and merged in #60187 ( |
teknium1
left a comment
There was a problem hiding this comment.
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:620PATCHes/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.pyand its corresponding tests; split the other changes.
Automated hermes-sweeper review.
| 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", |
There was a problem hiding this comment.
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.
Summary
discord_admin(action="edit_thread")Verification
./venv/bin/python -m pytest -q tests/tools/test_discord_tool.py