Repository navigation
fix(mentions): match typed group mentions when the agent identity name is decorated - #115278
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 10:55 AM ET / 14:55 UTC. ClawSweeper reviewWhat this changesThe PR makes shared identity-derived group mentions accept omitted decorative Unicode and adds QA scenarios for mention gating and literal separators. Merge readinessThis PR remains necessary: current main still treats a decorated identity name as one literal mention pattern, so bare typed names are gated. The supplied exact-head Gateway proof is credible; the remaining blocker is an exact-current-head review after its behind-main refresh. Priority: P1 Review scores
Verification
How this fits togetherGroup-message admission combines native mention facts with patterns derived from an agent identity before deciding whether to dispatch an agent turn. The changed fallback is shared by channel plugins, while QA Lab starts an ephemeral Gateway to exercise that dispatch-or-gate result. flowchart LR
A[Group message] --> B[Mention admission]
B --> C[Native mention facts]
B --> D[Identity-derived pattern]
D --> E[Unicode boundary decision]
C --> F[Dispatch or intentional gate]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceSource +267, Tests +664, Other +192. Total +1123 across 12 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Mantis proof suggestionA redacted Telegram group transcript would independently demonstrate the visible typed-mention outcome on one affected channel. A maintainer can ask Mantis to capture proof by posting this exact PR comment: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one shared identity-pattern derivation, preserve literal separators and false-positive boundaries, and rebase with refreshed exact-head Gateway proof before landing. Do we have a high-confidence way to reproduce the issue? Yes: current main literal-escapes the whole identity name, which source-proves that omitting embedded decoration cannot match. Is this the best way to solve the issue? Unclear: the shared derivation is the correct owner boundary and the supplied proof is targeted, but the full current branch and merge result were unavailable for direct inspection. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b365f7ec891f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (43 earlier review cycles; latest 8 shown)
|
883b90a to
e87cf3f
Compare
6d74c35 to
206811a
Compare
|
There is an additional requireMention bypass beyond the edge-backtracking issue: an emoji-only identity such as ❤️ tokenizes variation selector U+FE0F as its sole word token, so unrelated ☀️ or |
A derived name token has to carry an identity character. A run of bare marks is presentation, not identity: the variation selector in an emoji identity name, or an enclosing keycap, was derived as the only required token, so any unrelated emoji carrying the same mark satisfied the shared mention gate and was stripped from the message text. Non-selector combining marks stay part of the token they attach to.
A tag-sequence flag spells its region with U+E0020-U+E007F. Those tags are invisible on their own and no character class here admitted them, so the gap around them stayed a required separator and an identity ending in such a flag rejected the bare name. Keep the QA collector's id-keyed array composition too: merging two patch documents replaced the array wholesale, so two scenarios patching the same entry lost the earlier one's fields before the gateway started.
Composing every scenario patch into one merge-patch document cannot express "delete this parent, then recreate part of it": a scenario's deletion merged with a later scenario's object left the baseline siblings the first scenario removed. Startup now replays the resolved patches in scenario order against the real config, which is the semantics a scenario author writes, and the document merger this PR added is gone with it.
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
A numeric keycap spells its base with an identity character, so the token split absorbed the digit and the marks that follow, and the keycap never reached the decoration classifier: "Bot1" typed against "Bot1️⃣" stayed gated while "Bot#️⃣" already worked. The digit heading a keycap now stays out of the token, and the boundary assertions stop reading it as the first letter of a foreign word so the typed keycap still matches. A bare digit is unchanged: "Bot1" keeps requiring its 1.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
Landing note for the latest hosted ClawSweeper Rank-up moves:
|
Closes #115276
What Problem This Solves
In
requireMentiongroups, fallback mention patterns treated the fullidentity.nameas one literal. A displayed name such as小蝶🦋therefore ignored the natural typed form小蝶with no reply or error. The shared fallback affects every channel that derives mention patterns from the resolved agent identity.Root cause
The mention owner had no domain model for identity-bearing graphemes, optional decoration, and literal separators. Normalized matching also removes ZWJ/ZWNJ while raw stripping retains them, so one literal could not serve both paths safely.
The submitted decorated-name encoder then placed overlapping unbounded joiner/spacing repetitions at edge seams. Raw
stripMentionsrejection became quadratic:Botfollowed by 32,768 ZWJs and a foreign word took 3.55 seconds on the submitted head.QA Lab also collapsed scenario startup config into one merge patch. Later
nulldeletions were lost before Gateway startup, so a scenario could not remove the lane's pinned mention pattern and exercise the identity-derived path.Fix
gatewayConfigPatchesarray.No configured-pattern, native-mention, or
identity.emojipolicy changes. The owner remainssrc/auto-reply/reply/mentions.ts; channels continue consuming the shared result.Evidence
Head:
8569841f4b593670d8a0937ac6b092d997fa2a0bfa5ccda20a218f7952ae5bd4c180adb314b4baccfailed at 3552.07 ms against a 500 ms bound.src/auto-reply/reply/mentions.test.ts(88) plus five affected QA Lab suites (126).oxfmtandgit diff --check: pass.oxlint --deny-warningsacross all 11 repair files: pass.tsconfig.core.json,tsconfig.extensions.json: pass.srcshards,tsconfig.extensions.test.json,tsconfig.test.root.json: pass.小蝶(message48824) in a group withrequireMention: trueand agent identity小蝶🦋. The provider request recordedwas_mentioned: true,explicitly_mentioned_bot: false, andmention_source: "mention_pattern"; one mock-provider request crossed the Gateway boundary. The SUT returnedOPENCLAW_E2E_OKas message48825after 3.087 seconds. Recorded evidence:events.ndjson,summary.json,gateway.log, andmock-openai-requests.ndjson.The committed mock-Gateway scenarios remain the channel-boundary proof:
channel-mention-decorated-identitygates unrelated text, then accepts bare小蝶for identity小蝶🦋;channel-mention-separator-literalproves punctuation stays required. The prior public harness run passed both scenarios and is retained for reproducibility: run 31890054287, artifact 9248328353.Review resolution
The reported emoji-only variation-selector bypass is fixed at the parser boundary: selector/keycap graphemes are decoration, never standalone identity tokens. Cross-emoji and cross-keycap match/strip negatives remain green. GitHub has no unresolved review threads.
Change surface
+266/-29(net+237), including the shared Unicode derivation and ordered QA startup-patch owner.+681/-11(net+670).+192/-0.The production growth is the new shared capability, not a fallback path: one grapheme parser replaces the submitted code-point state machine, and callers use one ordered patch contract.