fix: V8.4.2.1 — UX-Bug INFO, Test-Assertions, Test-Isolation
Fix 1 (BEFUND 5): INFO-Konflikte senden keine Buttons mehr.
_ask_keyword_conflict_resolution() prüft jetzt ob alle Konflikte
INFO sind → reiner Text-Hinweis ohne Buttons. CRITICAL/WARNING
bekommen weiterhin Buttons.
Fix 2 (BEFUND 6): 3 Test-Assert-Erweiterungen.
test_conflict_buttons_sent_for_context_vs_100 prüft jetzt:
- ℹ️-Emoji im Text
- "Keine Aktion nötig" im Text
- Keine attachments (nur 2 args: room_id, text)
Fix 3 (BEFUND 7): Test-Isolation via /tmp/archivar_test_state.json.
_build_mock_adapter() setzt ARCHIVAR_STATE_PATH auf temp file
und löscht es vor jedem Test — verhindert persistierte
State-Leaks zwischen Testläufen (gleiches Pattern wie V8.4.1).
This commit is contained in:
+28
-17
@@ -3384,24 +3384,35 @@ class RocketChatAdapter(BasePlatformAdapter):
|
||||
f"in {c['room_name']} ({severity}: {explanation})"
|
||||
)
|
||||
|
||||
text = (
|
||||
f"⚠️ **Keyword-Konflikt erkannt** ({keyword_label}-Keywords):\n\n"
|
||||
+ "\n".join(conflict_lines)
|
||||
+ "\n\n👉 Möchtest Du die Keywords trotzdem verwenden oder andere wählen?"
|
||||
)
|
||||
# V8.4.2.1: INFO-Konflikte sind reine Hinweise — keine Buttons
|
||||
all_info = all(c["conflict_type"] == "INFO" for c in conflicts)
|
||||
|
||||
_build = self._get_build_custom_buttons()
|
||||
buttons = _build(
|
||||
["1️⃣ Trotzdem verwenden", "2️⃣ Anderes Keyword"],
|
||||
prefix=f"CONFLICT:{rid}",
|
||||
style="primary",
|
||||
)
|
||||
attachments = [{
|
||||
"color": "#f5a623",
|
||||
"title": "Keyword-Konflikt auflösen",
|
||||
"actions": buttons,
|
||||
}]
|
||||
await self._post_message_with_retry(operator_room_id, text, attachments=attachments)
|
||||
if all_info:
|
||||
text = (
|
||||
f"ℹ️ **Keyword-Hinweis** ({keyword_label}-Keywords):\n\n"
|
||||
+ "\n".join(conflict_lines)
|
||||
+ "\n\n💡 Der Butler wird im anderen Raum nachfragen. Keine Aktion nötig."
|
||||
)
|
||||
await self._post_message_with_retry(operator_room_id, text)
|
||||
else:
|
||||
text = (
|
||||
f"⚠️ **Keyword-Konflikt erkannt** ({keyword_label}-Keywords):\n\n"
|
||||
+ "\n".join(conflict_lines)
|
||||
+ "\n\n👉 Möchtest Du die Keywords trotzdem verwenden oder andere wählen?"
|
||||
)
|
||||
|
||||
_build = self._get_build_custom_buttons()
|
||||
buttons = _build(
|
||||
["1️⃣ Trotzdem verwenden", "2️⃣ Anderes Keyword"],
|
||||
prefix=f"CONFLICT:{rid}",
|
||||
style="primary",
|
||||
)
|
||||
attachments = [{
|
||||
"color": "#f5a623",
|
||||
"title": "Keyword-Konflikt auflösen",
|
||||
"actions": buttons,
|
||||
}]
|
||||
await self._post_message_with_retry(operator_room_id, text, attachments=attachments)
|
||||
|
||||
async def _ask_onboarding_question(self, operator_room_id: str) -> None:
|
||||
"""Sendet die aktuelle Interview-Frage an den Operator."""
|
||||
|
||||
Reference in New Issue
Block a user