storkit: done 460_bug_strip_bot_mention_fails_on_element_markdown_mention_pill_format
This commit is contained in:
+34
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: "strip_bot_mention fails on Element Markdown mention pill format"
|
||||
---
|
||||
|
||||
# Bug 460: strip_bot_mention fails on Element Markdown mention pill format
|
||||
|
||||
## Description
|
||||
|
||||
When Element sends a mention pill, the plain text `body` field contains a Markdown-style link like `[@timmy:crashlabs.io](https://matrix.to/#/@timmy:crashlabs.io) status`. The `strip_bot_mention` function uses prefix matching, so it tries to match `@timmy:crashlabs.io`, `@timmy`, and `Timmy` against text starting with `[` — none match. The entire message falls through to the LLM as a non-command.
|
||||
|
||||
`mentions_bot` works because it uses `body.contains(full_id)` which finds the MXID embedded inside the Markdown link. But `strip_bot_mention` fails because the text starts with `[`, not `@` or the display name.
|
||||
|
||||
This causes all deterministic bot commands (status, help, ambient, etc.) to be routed to the LLM instead of being handled by the bot when the user uses Element's mention pill (@-autocomplete).
|
||||
|
||||
## How to Reproduce
|
||||
|
||||
1. In Element, type `@timmy` and use the autocomplete pill to mention the bot
|
||||
2. Append a command like `status`
|
||||
3. Send the message
|
||||
|
||||
## Actual Result
|
||||
|
||||
The command falls through to the LLM. The bot logs show no "Handled bot command" entry. The plain body is `[@timmy:crashlabs.io](https://matrix.to/#/@timmy:crashlabs.io) status` which `strip_bot_mention` cannot parse.
|
||||
|
||||
## Expected Result
|
||||
|
||||
The bot should strip the Markdown mention link wrapper, extract the MXID or display name, and match the command deterministically. `@timmy status` via mention pill should produce the same pipeline status output as typing `@timmy status` manually.
|
||||
|
||||
## Acceptance Criteria
|
||||
|
||||
- [ ] strip_bot_mention handles Markdown link format `[display](https://matrix.to/#/@user:server) command` and extracts the command text
|
||||
- [ ] Deterministic commands (status, help, ambient, etc.) work when invoked via Element mention pill autocomplete
|
||||
- [ ] Unit tests cover the Markdown mention pill body format
|
||||
- [ ] Existing strip_bot_mention tests still pass (plain @mention and display name formats)
|
||||
Reference in New Issue
Block a user