oclaw/tests/test_confirm_affirmative.py
oliver d3f621b58b Cache inventory MCP lists and accept YES as WhatsApp confirm.
Extend short TTL reuse to listManagedNe/queryUmeNeInventory to cut list self-loops, and treat short YES/continue as confirmation when a token is pending.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-10 22:56:50 +08:00

13 lines
636 B
Python

from __future__ import annotations
from runtime.orchestration.security import has_explicit_confirmation_token
def test_whatsapp_yes_confirms_outstanding_token() -> None:
assert has_explicit_confirmation_token("@bot YES", "abc123")
assert has_explicit_confirmation_token("YES", "abc123")
assert has_explicit_confirmation_token("please continue", "abc123")
assert has_explicit_confirmation_token("确认", "abc123")
assert not has_explicit_confirmation_token("YES", None)
assert not has_explicit_confirmation_token("maybe later", "abc123")
assert has_explicit_confirmation_token("confirm abc123", "abc123")