Skip to content

feat(discord): auto-create threads for configured channels - #268

Open
azaz44 wants to merge 3 commits into
moazbuilds:masterfrom
azaz44:feature/discord-auto-thread-202609091240
Open

azaz44 wants to merge 3 commits into
moazbuilds:masterfrom
azaz44:feature/discord-auto-thread-202609091240

Conversation

@azaz44

@azaz44 azaz44 commented Sep 10, 2026

Copy link
Copy Markdown

Summary

  • Adds discord.autoThreadChannels — channel IDs where every top-level message auto-creates a fresh, isolated-session thread (same feature Hermes has), instead of replying inline on the parent channel
  • Thread is created anchored to the triggering message (POST /channels/{id}/messages/{message_id}/threads), so Discord shows the quoted original automatically — no extra plumbing needed
  • Once Claude replies, the placeholder thread name is replaced with an AI-generated title (Haiku) via a fire-and-forget rename, so it never blocks the reply
  • Reactions stay correctly anchored to the original message in the parent channel even when the reply itself goes to the new thread
  • Existing manual thread creation (the "hire"/"fire" AI intent classifier) is untouched and takes priority — auto-threading only kicks in for channels opted into autoThreadChannels when no thread-management intent was detected
  • Also swapped two pinned model snapshots (claude-haiku-4-5-20251001, claude-sonnet-4-20250514) for the CLI's haiku/sonnet aliases, so intent classification and title generation don't hard-break if Anthropic retires that specific dated snapshot

Config

"discord": {
  "listenChannels": ["123..."],
  "autoThreadChannels": ["123..."]
}

A channel must be in both listenChannels (bot listens there at all) and autoThreadChannels (opts into auto-threading). Default [] — fully backward compatible, opt-in per channel.

Test plan

  • bun test — same pass/fail counts as on master (134 pass / 3 pre-existing unrelated fails, confirmed via git stash comparison)
  • bunx tsc --noEmit — clean on the two touched files
  • Manually tested live against a running claudeclaw instance for ~24h (bind-mounted /app/src in a Docker deployment) — auto-thread creation, quoted original, session isolation, and AI title rename all confirmed working

🤖 Generated with Claude Code

azaz44 and others added 3 commits September 9, 2026 12:43
Adds discord.autoThreadChannels — channel IDs where every top-level
message spawns its own thread (anchored to the message so Discord
shows the quoted original), gets an isolated session, and is renamed
with an AI-generated title once Claude replies.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
--model claude-haiku-4-5-20251001 and claude-sonnet-4-20250514 break
outright if Anthropic retires that dated snapshot. The claude CLI
resolves 'haiku'/'sonnet' aliases to the latest model on its own, so
use those instead — same behavior today, no hard dependency on a
snapshot staying available.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@azaz44
azaz44 force-pushed the feature/discord-auto-thread-202609091240 branch from 6232bbe to 10e9887 Compare September 10, 2026 18:15
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.

1 participant