Skip to content

fix(discord): add auto-thread fallback path - #8692

Closed
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/discord-auto-thread-fallback
Closed

fix(discord): add auto-thread fallback path#8692
sgaofen wants to merge 1 commit into
NousResearch:mainfrom
sgaofen:codex/discord-auto-thread-fallback

Conversation

@sgaofen

@sgaofen sgaofen commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make Discord auto-thread creation fall back to a seeded parent-channel message when message.create_thread(...) is rejected
  • preserve the existing direct path for the common case, but keep auto-threading alive on channels where only the fallback succeeds
  • add focused Discord tests for the fallback-success and double-failure paths

Root Cause

Discord's manual /thread flow already had a fallback path when direct thread creation was rejected, but the automatic mention-triggered thread path only tried message.create_thread(...) once and gave up. That left some channels able to thread the first mention but silently fail later mentions when Discord rejected the direct path.

Addresses #8487.

Testing

  • python3 -m py_compile gateway/platforms/discord.py tests/gateway/test_discord_slash_commands.py
  • uv run --directory /Users/stephenyu/Documents/hermes-agent-wt-8487 --extra dev pytest -o addopts='' tests/gateway/test_discord_slash_commands.py -q

Platform Tested

  • macOS 15.x (Apple Silicon)

Contribution Guide Notes

  • Reviewed CONTRIBUTING.md and checked for existing open PRs before submitting this scoped bug fix.
  • Ran the targeted verification commands listed above for this PR. I have not claimed a full repo-wide pytest tests/ -q pass unless explicitly noted.

@sgaofen sgaofen changed the title [codex] Add Discord auto-thread fallback path fix(discord): add auto-thread fallback path Apr 13, 2026
@sgaofen
sgaofen marked this pull request as ready for review April 13, 2026 00:51
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #11629#11629

Your commit (c57a0052) was cherry-picked with authorship preserved. Closes #8487.

The seed-message-then-create-thread fallback pattern was exactly right — handles the case where Discord rejects direct message.create_thread() on subsequent mentions in a channel (API-side state after the first thread creation), but still lets the manual /thread flow path succeed. Proper reason string (Auto-threaded from mention by <user>) and thorough double-failure test coverage. Nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants