Merged
Conversation
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>
Add buildDingTalkContext helper function to construct a JSON string containing DingTalk-specific context fields (sender info, conversation details, admin status, etc.). Populate the PlatformContext field in InboundMessage with this JSON for platform context injection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Populate platform_context in the <task_meta> JSON when PlatformContext is present on the inbound message, using json.RawMessage so it embeds as structured JSON rather than an escaped string. Omits the field when empty (omitempty). Adds internal tests for both the present and absent cases via TDD. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t injection Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…plication Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntext Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tors in app - Remove PlatformContext field from InboundMessage struct in internal/platform/interfaces.go - Register platform context extractors (feishu, dingtalk, wecom) at the start of buildPlatforms() in internal/app/app.go - Build verification: only dispatcher.go errors remain (expected, will be fixed in Task 8) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s raw Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…text Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ExtractContext now parses message.mentions from the raw event and injects them (key, open_id, union_id, name) into platform_context so the AI can identify who was @-mentioned. tenant_key removed from both sender and mention fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move RegisterExtractor calls inside each platform's Enabled guard so extractors are only registered for enabled platforms - Remove redundant senderID local variable in wecom ExtractContext - Drop WHAT-only comments that the code already makes self-evident Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…aces - Nest open_id, union_id, sender_type under sender namespace - Nest chat_id, chat_type, message_id, message_type, mentions under message namespace - Add message_type and sender_type fields to extracted context Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
User @_user_X keys are kept as-is in message content; only the bot's mention key is replaced with its display name so the downstream stripBotMentions pass continues to work correctly. 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>
…fields Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntext Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…tContext Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bee is platform-agnostic and does not need platform_context in its message metadata. Worker retains platform_context injection unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bee is platform-agnostic and does not need platform_context. Worker injection in dispatcher.go is unchanged. 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>
Use wecomContextFields typed struct to preserve original WeCom wire format field names (msgid, aibotid, chatid, chattype, from, msgtype). Removes chatid override logic for single chats and adds msgtype. Consistent with DingTalk's typed struct pattern. 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>
Each platform's @mention regex is now isolated to messages from that platform. Eliminates cross-platform prefix collision (e.g. DingTalk 'openbee' regex mangling WeCom 'openbee本地测试' messages). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the flat name pool with an explicit platform→name map so each platform's strip regex is isolated to its own messages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The buildREs helper was keying the regex map by the message's own platform, so the "unknown platform" case always matched. Add regPlatform field to separate registration platform from message platform so the test correctly exercises the no-op path. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and centralize ExtractContext marshal pattern Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ped platform names Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Drop wecomContextFields struct; inline selected fields as map[string]any directly in ExtractContext - Delete WHAT comment on removed struct - Trim resolveMentions comment to non-obvious WHY only - Replace strings.NewReplacer with strings.ReplaceAll in resolveMentions (at most one bot key) - Add @ pre-filter in stripBotMention to skip regex scan for non-mention messages Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…imBatch - Make stripBotMention a method on *Gateway instead of a free function taking the map as a parameter - Fix buildREs test helper to delegate to WithPlatformBotNames so regex pattern changes propagate automatically - Trim implementation-narrating clause from resolveMentions comment in feishu handler - Remove Raw field from ClaimedMessage and drop raw from ClaimBatch SELECT; the feeder never uses it and the field adds unnecessary DB I/O on every poll tick Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Merge main branch changes (worker uniqueness validation, BotNames config helper, feeder/manager improvements) into the platform context injection feature branch, keeping per-platform bot name stripping via WithPlatformBotNames. 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.