fix(openclaw): route wakeup phrases back to menu
All checks were successful
CD Pipeline / deploy (push) Successful in 2m55s

This commit is contained in:
OoO
2026-05-02 16:03:49 +08:00
parent 673982d83b
commit 7b6423fa67
3 changed files with 87 additions and 1 deletions

View File

@@ -38,6 +38,24 @@ def test_webhook_menu_command_handles_bot_suffix(monkeypatch):
assert calls == [("menu", "", -200, 55)]
def test_openclaw_answer_wakeup_query_returns_menu():
from routes import openclaw_bot_routes as bot
text, kb = bot.openclaw_answer("小龍蝦")
assert "OpenClaw小O" in text
assert kb == bot.quick_menu_keyboard()
def test_openclaw_answer_variants_are_menu_wakeup():
from routes import openclaw_bot_routes as bot
assert bot._looks_like_wakeup_prompt("小O_小龍蝦") is True
assert bot._looks_like_wakeup_prompt("Hello, 小O") is True
assert bot._looks_like_wakeup_prompt("今天業績") is False
assert bot._looks_like_wakeup_prompt("你好") is True
def test_private_menu_command_is_allowed_when_no_whitelist_and_fallback_enabled(monkeypatch):
from routes import openclaw_bot_routes as bot