fix(adapter): CLARIFY-Trennzeichen-Bug — :: vs : zwischen clarify_id und choice

_build_custom_buttons() sendet Payloads mit :: (Doppel-Doppelpunkt),
aber _process_incoming() splittete mit text.split(':', 2) → choice=':1'
→ ':1'.isdigit()=False → Clarify nie resolved → Gateway Timeout.

Fix: Zweistufiger Split — erst '::' prüfen (neues Format),
dann ':' als Fallback (Other-Button). Beide Formate werden erkannt:
- CLARIFY:id::1 (numerischer Button)
- CLARIFY:id:other (Other-Button)

Architektur: Rainer | Implementierung: Miguel | QG: Rainer F1-F5 bestanden
This commit is contained in:
Hermes Agent
2026-06-09 21:32:07 +02:00
parent b21a8bec19
commit e7e6b66ba2
+9 -1
View File
@@ -638,8 +638,16 @@ class RocketChatAdapter(BasePlatformAdapter):
# Handle CLARIFY button responses: CLARIFY:<clarify_id>:<choice> or CLARIFY:<clarify_id>:other # Handle CLARIFY button responses: CLARIFY:<clarify_id>:<choice> or CLARIFY:<clarify_id>:other
if is_clarify_response and text.startswith("CLARIFY:"): if is_clarify_response and text.startswith("CLARIFY:"):
try: try:
if "::" in text:
# Neues Format: CLARIFY:<id>::<choice> (via _build_custom_buttons)
prefix_part, choice = text.split("::", 1)
clarify_id = prefix_part.split(":", 1)[1]
else:
# Altes Format: CLARIFY:<id>:other (Other-Button)
parts = text.split(":", 2) parts = text.split(":", 2)
if len(parts) == 3: if len(parts) != 3:
logger.debug("[rocketchat] Unrecognized CLARIFY format: %s", text)
return
_, clarify_id, choice = parts _, clarify_id, choice = parts
if choice == "other": if choice == "other":
# For "Other" button, enable text capture mode # For "Other" button, enable text capture mode