Repository navigation
2026-89: fix(discord): capture replies to the bot without an explicit mention - #89
Merged
Merged
Conversation
A Discord reply to one of the bot's own messages was dropped whenever the user did not also @mention the bot: the guild-channel poll filter required isMentioned or a literal bot mention. The captain answers a bot post by replying to it, and Discord adds no mention for that, so the command never reached firstmate. Treat a reply whose referenced message was authored by the bot as an inbound mention, and discover the bot's DM channels even when FM_DISCORD_CHANNEL_ID names a guild-channel allowlist. Carry the author id in the captured payload so firstmate can authorise before acting on it. Regression coverage: reply to a bot message with and without a mention, a reply to a member still ignored, and a DM command captured under a configured channel allowlist.
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
* feat(discord): captain command channel for mention-free requests Adds an explicit opt-in channel list where an authorized captain's plain message is an inbound Firstmate request, without typing @FIRST Crew (which forces a Korean/English IME round-trip on every call). - bin/fm-discord-lib.sh: resolve FM_DISCORD_COMMAND_CHANNELS (one place); a command channel that is also excluded is dropped with an explicit diagnostic (exclusion wins). - bin/fm-discord-poll.js: allow the mention-free path only when the polled channel is a command channel AND the author is authorized; bot messages and unauthorized authors are still ignored. - bin/fm-discord-poll.sh: export the resolved command channels to the poll. - docs/configuration.md: document the setting and how it differs from the polling allowlist. - tests: authorized+command-channel plain -> captured; unauthorized -> ignored; ordinary channel plain -> ignored; duplicate poll -> one inbox record; command/exclusion conflict -> fail-safe diagnostic. Preserves #89 (reply to bot), #93 (durable wake on capture), DM polling, and the existing @mention fallback; all inputs still normalize to the same discord-selfhosted x-inbox + durable-wake path. * no-mistakes(document): Document Discord command channel configuration * no-mistakes(lint): Replace ls/grep inbox count with glob loop
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
…89) A Discord reply to one of the bot's own messages was dropped whenever the user did not also @mention the bot: the guild-channel poll filter required isMentioned or a literal bot mention. The captain answers a bot post by replying to it, and Discord adds no mention for that, so the command never reached firstmate. Treat a reply whose referenced message was authored by the bot as an inbound mention, and discover the bot's DM channels even when FM_DISCORD_CHANNEL_ID names a guild-channel allowlist. Carry the author id in the captured payload so firstmate can authorise before acting on it. Regression coverage: reply to a bot message with and without a mention, a reply to a member still ignored, and a DM command captured under a configured channel allowlist.
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
* feat(discord): captain command channel for mention-free requests Adds an explicit opt-in channel list where an authorized captain's plain message is an inbound Firstmate request, without typing @FIRST Crew (which forces a Korean/English IME round-trip on every call). - bin/fm-discord-lib.sh: resolve FM_DISCORD_COMMAND_CHANNELS (one place); a command channel that is also excluded is dropped with an explicit diagnostic (exclusion wins). - bin/fm-discord-poll.js: allow the mention-free path only when the polled channel is a command channel AND the author is authorized; bot messages and unauthorized authors are still ignored. - bin/fm-discord-poll.sh: export the resolved command channels to the poll. - docs/configuration.md: document the setting and how it differs from the polling allowlist. - tests: authorized+command-channel plain -> captured; unauthorized -> ignored; ordinary channel plain -> ignored; duplicate poll -> one inbox record; command/exclusion conflict -> fail-safe diagnostic. Preserves #89 (reply to bot), #93 (durable wake on capture), DM polling, and the existing @mention fallback; all inputs still normalize to the same discord-selfhosted x-inbox + durable-wake path. * no-mistakes(document): Document Discord command channel configuration * no-mistakes(lint): Replace ls/grep inbox count with glob loop
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
…89) A Discord reply to one of the bot's own messages was dropped whenever the user did not also @mention the bot: the guild-channel poll filter required isMentioned or a literal bot mention. The captain answers a bot post by replying to it, and Discord adds no mention for that, so the command never reached firstmate. Treat a reply whose referenced message was authored by the bot as an inbound mention, and discover the bot's DM channels even when FM_DISCORD_CHANNEL_ID names a guild-channel allowlist. Carry the author id in the captured payload so firstmate can authorise before acting on it. Regression coverage: reply to a bot message with and without a mention, a reply to a member still ignored, and a DM command captured under a configured channel allowlist.
Ivory2024
added a commit
that referenced
this pull request
Oct 7, 2026
* feat(discord): captain command channel for mention-free requests Adds an explicit opt-in channel list where an authorized captain's plain message is an inbound Firstmate request, without typing @FIRST Crew (which forces a Korean/English IME round-trip on every call). - bin/fm-discord-lib.sh: resolve FM_DISCORD_COMMAND_CHANNELS (one place); a command channel that is also excluded is dropped with an explicit diagnostic (exclusion wins). - bin/fm-discord-poll.js: allow the mention-free path only when the polled channel is a command channel AND the author is authorized; bot messages and unauthorized authors are still ignored. - bin/fm-discord-poll.sh: export the resolved command channels to the poll. - docs/configuration.md: document the setting and how it differs from the polling allowlist. - tests: authorized+command-channel plain -> captured; unauthorized -> ignored; ordinary channel plain -> ignored; duplicate poll -> one inbox record; command/exclusion conflict -> fail-safe diagnostic. Preserves #89 (reply to bot), #93 (durable wake on capture), DM polling, and the existing @mention fallback; all inputs still normalize to the same discord-selfhosted x-inbox + durable-wake path. * no-mistakes(document): Document Discord command channel configuration * no-mistakes(lint): Replace ls/grep inbox count with glob loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
클로드
앱
— 오후 10:53
🎬 [이미 등록된 영화]
• 제목: )
• Notion Link: https://app.notion.com/p/3ef699a4fba6804f8848ea9d63ccfab5
박평식 — 오후 10:58
누락된 정보들 채워넣어
병렬로. 이런 식으로 답멘션 달면 명령 듣고 처리해줘야 하는데 반응이 없어 코드 수정해
What Changed
bin/fm-discord-poll.js: treat a message as an inbound command when it is a Discord reply to one of the bot's own messages (referenced_message.author.id === botId), even without an@mention; also tags forwarded messages withauthor_id.bin/fm-discord-poll.js: DM channel discovery now runs unconditionally whenFM_DISCORD_ALLOW_DMSis set, instead of being skipped when a guild channel allowlist is also configured, and dedupes against channels already intargetChannels.docs/configuration.md: documents that replying to any bot message counts as a mention, and that DM polling runs alongside a configured channel allowlist.tests/fm-discord-selfhosted.test.sh: adds coverage for the reply-without-mention and concurrent DM/allowlist polling behavior.🤖 Generated with Claude Code
Risk Assessment
✅ Low: Small, well-scoped fix: adds reply-to-bot detection and moves DM polling out of the allowlist-exclusive branch, matches stated intent, covered by new behavioral tests that exercise the real script and assert actual output files, no change to the existing authorization boundary.
Testing
Ran tests/fm-discord-selfhosted.test.sh which exercises the actual fm-discord-poll.sh/js binary against a fake Discord backend (fake node shim), checking real wake output and real state/x-inbox JSON files it writes. All scenarios relevant to this change passed: reply to bot's own message without mention is captured, reply to bot with mention still strips mention and is captured, reply to a non-bot member's message without mention is correctly ignored, and DM channels are still polled when a channel allowlist is configured. Worktree left clean (test uses its own tmp dirs).
Evidence: fm-discord-selfhosted.test.sh run
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-discord-selfhosted.test.sh (full file, 11 tests including 4 new ones)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.