human hand off fix

This commit is contained in:
debu-2 2026-10-06 07:42:41 +05:30
parent 7b9e574b86
commit 0981262612
5 changed files with 154 additions and 24 deletions

View file

@ -20,20 +20,20 @@ def test_human_handoff_runtime_is_enabled():
assert callable(resolve_handoff_from_inbound)
def test_private_subject_contains_rule_sender_and_external_subject():
def test_private_subject_contains_customer_name_and_external_subject():
subject = build_handoff_subject(
rule_name="Finance approvals",
external_sender="customer@example.com",
sender_name="Parth Dixit",
external_sender="parthdixit091@gmail.com",
external_subject="Invoice 42",
)
assert subject == (
"Finance approvals · handoff · customer@example.com · Invoice 42"
"Parth Dixit · handoff · parthdixit091@gmail.com · Invoice 42"
)
def test_private_subject_removes_header_line_breaks():
subject = build_handoff_subject(
rule_name="Urgent\r\nBcc: attacker@example.com",
sender_name="Urgent\r\nBcc: attacker@example.com",
external_sender="customer@example.com",
external_subject="Help",
)