Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add BotName config to each platform (feishu/dingtalk/wecom/telegram/weixin). Gateway strips exact @<BotName> tokens from message content before passing to command handlers, so commands like /clear and /engine work when prefixed or suffixed with @机器人. Stored message content is unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add platform bot_name input to all 5 platforms in the interactive config wizard. Prompts appear after required fields, leave empty to skip @mention stripping. Updates configValues, loadExistingConfig, config template, and i18n strings (en + zh). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…pBotMentions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t-path Add IsCommand(content string) bool to the CommandHandler interface so Dispatch can detect and handle slash commands immediately, skipping the debounce window entirely. Concrete handlers (EngineCommandHandler, ClearCommandHandler, chainedHandler) implement the method with pure token matching; no side effects. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Route slash commands through a serialized buffered channel instead of calling HandleCommand synchronously in Dispatch, so the platform receiver goroutine returns immediately. Also removes the now-unreachable HandleCommand call in onDebounce that was dead code after the IsCommand fast-path was added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Apply stripBotMentions to both the debounce path and DB storage so that @botName and surrounding whitespace are removed from IngestedMessage.Content and BatchMsg.Content for all inbound messages. Replace the strings.Fields word-split implementation with a regex that preserves multi-line formatting. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pre-compile @mention patterns once in WithBotNames instead of recompiling on every message dispatch. Also replace strings.Fields allocation in IsCommand with allocation-free strings.HasPrefix checks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…oup commands Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Extract compileBotNameREs helper to eliminate duplication between WithBotNames and strip_test.go; add empty-string guard to prevent compiling a bare @-only pattern - Extract isExactOrPrefixed helper so ClearCommandHandler and EngineCommandHandler share a single IsCommand implementation - Thread gateway lifecycle context into runCommandConsumer so in-flight commands respect graceful shutdown - Remove what-comments on stripBotMentions, Run, and HandleCommand Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- promptBotName: remove survey.Required validator so users can leave
bot name empty as the prompt message instructs ("leave empty to skip")
- gateway: store stripped content in Dispatch so onDebounce uses it
directly, avoiding a second regex pass per message per bot name
- gateway: runCommandConsumer exits via ctx.Done() rather than draining
the channel with a cancelled context; also removes the send-on-closed
cmdCh panic risk since the channel is no longer closed in Run
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ip' from bot_name prompt Bot name is mandatory; the prompt copy was wrong. Remove the misleading hint from both en/zh locales and keep survey.Required. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ot_name optional - Move stripBotMentions() call before g.mu.Lock() in Dispatch(); botNameREs is immutable after construction so no lock is needed, and this keeps regex work out of the critical section - Drop survey.Required from promptBotName so users on DM-only platforms can leave bot_name empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bot name must be provided when configuring a platform; the optional stripping behaviour only activates when the name is non-empty, but leaving it blank during setup is a misconfiguration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.