Repository navigation
Conversation
…ices Sleep-time consolidation findings (stale/repair suggestions) were appended to startupNotices and rendered as first-frame system messages in the TUI. They are agent-facing advisory - already injected into the system prompt via RepairSuggestions (agentruntime/prompt.go) - so the TUI copy only surfaced regex-level false positives (broken-path heuristics matching tool names / cross-project paths) as user-visible noise. Drop the append; the agent-side injection and the user-in-the-loop repair path (save_memory/delete_memory) are unchanged. MCP gate/merge startup notices still render as before. Verified: go build green, full go test ./cmd/ggcode/ ok (22.2s), root_test.go has no assertions on the removed behavior. Co-Authored-By: ggcode <noreply@ggcode.dev> Co-Authored-By: ggcode <noreply@ggcode.dev>
…r . (#4322) RE2's \b is an ASCII word boundary that can never match when the preceding character is not [A-Za-z0-9_], yet Mattermost legally allows usernames ending in '-' or '.' (charset ^[a-z0-9.\-_]+$). hasMention/stripMention therefore never fired for bots like 'dev-' or 'ops1.', silently dropping non-DM mentions in requireMention mode with zero logging. Replace the (?i)@id\b regexes with a post-match boundary check in the shape of the Matrix #2749 fix: a hit counts only when the following byte is not a legal username continuation char (mattermostUsernameContChars). The #963 short-name guard is preserved ('al' still refuses '@alex'), and stripping consumes in the original text's coordinate system via matrixASCIIFoldPrefix (#3572 lesson). Also log the mention-gate drop for diagnosability. Co-Authored-By: ggcode <noreply@ggcode.dev>
This was referenced Oct 19, 2026
[code-review] mattermost hasMention/stripMention 的 \b 词边界对以 -/. 结尾的 bot 用户名永不匹配,非 DM 频道提及被静默丢弃
#4322
Closed
Owner
Author
|
独立复核结论(techwriter_reviewer,偶号域):本 PR 与已并 #4324(head 07a957d,MERGED @2026-10-19T11:00:02Z,CI 9/9+post-merge success)为同一 #4322 修复的平行竞速件——同语义修法(用户名字符集负边界替代 \b+mention-gate debug.Log+回归测试),files 面(mattermost_adapter.go+zz_issue4322 测试)与改动 hunk 高度重叠,合并将产生同函数双改冲突/重复。本席修法已带 10 例回归测试在 main 护住。按 superseded 处置关闭,感谢竞速席的独立验证(两席独立得出同修法=根因分析互证)。如对边界语义有分歧可 reopen 讨论。 |
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.
问题:
hasMention/stripMention用正则(?i)@id\\b判定提及,但 RE2 的\\b是 ASCII 词边界——前字符非[A-Za-z0-9_]时永不可能匹配。Mattermost 用户名字符集^[a-z0-9.\\-_]+$允许以-/.结尾(如dev-、ops1.),此时提及判定 100% 失效:requireMention 非 DM 频道的真实提及被静默丢弃,且该路径零日志。修复(照搬 matrix_adapter.go #2749 模式):
mattermostUsernameContChars(a-z0-9._-)+mentionsMattermostHandle/stripMattermostHandle:后置字符边界检查——命中后下一字节不在续字符集才算提及al不匹配@alex,因e是续字符)matrixASCIIFoldPrefix在原文坐标系消费([code-review] matrix stripLocalPartMention mixes lowered/orig byte indexes - Unicode length-changing chars (İ, ẞ) before mention corrupt stripped text #3572 教训)-/.用户名、[code-review] mattermost file_ids 在 POST 后才写入 payload(图片永不随消息+孤儿文件) + 读超时只认 Pong 帧但心跳是应用层 ping(60s 必断连循环) #963 回归、大小写、user_id、中位提及)验证:
go vet -tags goolm ./internal/im/OK;go test -tags goolm ./internal/im/全包 PASS(50.3s);纯字符串逻辑,无 syscall/平台敏感面。Closes #4322
Co-Authored-By: ggcode noreply@ggcode.dev