fix(python/robomp): updated mention regex to correctly reject suffixes

- Updated the mention extraction regex to prevent partial matching when a suffix follows the `[bot]` identifier.
- Added a regression test to ensure that invalid extended suffixes are correctly rejected.
This commit is contained in:
can1357
2026-06-21 19:26:42 +02:00
parent 24a0c8428a
commit 69d0ac4dd3
2 changed files with 5 additions and 1 deletions
@@ -538,6 +538,10 @@ def test_extract_mention_strips_literal_app_suffix_from_body() -> None:
assert extract_mention("@roboomp[bot] go ahead", "roboomp[bot]") == "go ahead"
def test_extract_mention_rejects_extended_literal_app_suffix() -> None:
assert extract_mention("@roboomp[bot]-helper go ahead", "roboomp[bot]") is None
def test_extract_mention_returns_none_without_mention() -> None:
assert extract_mention("hello there", "robomp-bot") is None
assert extract_mention(None, "robomp-bot") is None