From 35258488e6e617a2bb4eac5f08ea39d5d915baab Mon Sep 17 00:00:00 2001 From: smriti-nyx Date: Wed, 20 May 2026 12:54:58 +0530 Subject: [PATCH 1/4] feat: add crisis helpline numbers for 10 new countries --- humane_proxy/config.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/humane_proxy/config.yaml b/humane_proxy/config.yaml index 818fad7..93aace2 100644 --- a/humane_proxy/config.yaml +++ b/humane_proxy/config.yaml @@ -199,7 +199,25 @@ safety: response_mode: "block" # Optional: override the default block message (leave empty to use built-in). - block_message: "" + block_message: | + 💙 You're not alone. Please reach out to a crisis helpline in your country: + + 🇺🇸 USA: 988 (Suicide & Crisis Lifeline) + 🇬🇧 UK: 116 123 (Samaritans) + 🇨🇦 Canada: 1-833-456-4566 + 🇦🇺 Australia: 13 11 14 (Lifeline) + 🇮🇳 India: iCall — 9152987821 + 🇯🇵 Japan: 0120-783-556 (Inochi no Denwa) + 🇰🇷 South Korea: 1393 (Crisis Counseling) + 🇩🇪 Germany: 0800 111 0 111 (Telefonseelsorge) + 🇫🇷 France: 3114 (Numéro National Prévention Suicide) + 🇪🇸 Spain: 024 (Línea de Atención a conducta suicida) + 🇮🇹 Italy: 800 274 274 (Telefono Amico) + 🇲🇽 Mexico: 800 290 0024 (SAPTEL) + 🇳🇿 New Zealand: 1737 (Need to Talk?) + 🇧🇷 Brazil: 188 (CVV) + + You matter. Help is available 24/7. 💙 criminal_intent: # Score threshold for escalation (below this → only log, no webhook). From f56ec3e827ea9e2201024d653f7b2fec60a9ed2f Mon Sep 17 00:00:00 2001 From: smriti-nyx Date: Wed, 20 May 2026 13:07:31 +0530 Subject: [PATCH 2/4] fix: correct YAML indentation for block_message --- humane_proxy/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/humane_proxy/config.yaml b/humane_proxy/config.yaml index 93aace2..5e40a47 100644 --- a/humane_proxy/config.yaml +++ b/humane_proxy/config.yaml @@ -199,7 +199,7 @@ safety: response_mode: "block" # Optional: override the default block message (leave empty to use built-in). - block_message: | + block_message: | 💙 You're not alone. Please reach out to a crisis helpline in your country: 🇺🇸 USA: 988 (Suicide & Crisis Lifeline) From 44ac11f64d9180d10eed851ca6c2e6ae81f84a70 Mon Sep 17 00:00:00 2001 From: smriti-nyx Date: Mon, 25 May 2026 13:42:08 +0530 Subject: [PATCH 3/4] fix: move helplines to CARE_RESPONSE_BLOCK, revert config block_message, add tests for new countries --- humane_proxy/config.yaml | 25 ++++++------------------- tests/test_care_response.py | 20 ++++++++++++++++++++ 2 files changed, 26 insertions(+), 19 deletions(-) diff --git a/humane_proxy/config.yaml b/humane_proxy/config.yaml index 5e40a47..8e8f088 100644 --- a/humane_proxy/config.yaml +++ b/humane_proxy/config.yaml @@ -199,25 +199,12 @@ safety: response_mode: "block" # Optional: override the default block message (leave empty to use built-in). - block_message: | - 💙 You're not alone. Please reach out to a crisis helpline in your country: - - 🇺🇸 USA: 988 (Suicide & Crisis Lifeline) - 🇬🇧 UK: 116 123 (Samaritans) - 🇨🇦 Canada: 1-833-456-4566 - 🇦🇺 Australia: 13 11 14 (Lifeline) - 🇮🇳 India: iCall — 9152987821 - 🇯🇵 Japan: 0120-783-556 (Inochi no Denwa) - 🇰🇷 South Korea: 1393 (Crisis Counseling) - 🇩🇪 Germany: 0800 111 0 111 (Telefonseelsorge) - 🇫🇷 France: 3114 (Numéro National Prévention Suicide) - 🇪🇸 Spain: 024 (Línea de Atención a conducta suicida) - 🇮🇹 Italy: 800 274 274 (Telefono Amico) - 🇲🇽 Mexico: 800 290 0024 (SAPTEL) - 🇳🇿 New Zealand: 1737 (Need to Talk?) - 🇧🇷 Brazil: 188 (CVV) - - You matter. Help is available 24/7. 💙 + block_message: "" + + + + + criminal_intent: # Score threshold for escalation (below this → only log, no webhook). diff --git a/tests/test_care_response.py b/tests/test_care_response.py index b753218..2de6b99 100644 --- a/tests/test_care_response.py +++ b/tests/test_care_response.py @@ -102,3 +102,23 @@ def test_custom_message_overrides_default(self): with patch("humane_proxy.escalation.router.get_config", return_value=self._custom_config()): result = get_self_harm_response() assert result["message"] == "Custom care message for tests." +class TestCareResponseBlockNewCountries: + """New country helplines are present in the built-in care response.""" + + def test_message_contains_japan_resource(self): + assert "0120-783-556" in CARE_RESPONSE_BLOCK or "Inochi" in CARE_RESPONSE_BLOCK + + def test_message_contains_south_korea_resource(self): + assert "1393" in CARE_RESPONSE_BLOCK + + def test_message_contains_spain_resource(self): + assert "717 003 717" in CARE_RESPONSE_BLOCK or "Esperanza" in CARE_RESPONSE_BLOCK + + def test_message_contains_italy_resource(self): + assert "Telefono Amico" in CARE_RESPONSE_BLOCK or "02 2327 2327" in CARE_RESPONSE_BLOCK + + def test_message_contains_mexico_resource(self): + assert "SAPTEL" in CARE_RESPONSE_BLOCK or "5259-8121" in CARE_RESPONSE_BLOCK + + def test_message_contains_new_zealand_resource(self): + assert "1737" in CARE_RESPONSE_BLOCK or "Lifeline" in CARE_RESPONSE_BLOCK \ No newline at end of file From cdb2bdbf970bde6c99ca8e305f0f587dc4bcca16 Mon Sep 17 00:00:00 2001 From: smriti-nyx Date: Thu, 28 May 2026 14:56:25 +0530 Subject: [PATCH 4/4] fix: remove trailing blank lines, add country helplines to router.py, fix test assertions --- humane_proxy/config.yaml | 5 ----- humane_proxy/escalation/router.py | 21 +++++++++++++++++++++ tests/test_care_response.py | 10 +++++----- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/humane_proxy/config.yaml b/humane_proxy/config.yaml index 8e8f088..818fad7 100644 --- a/humane_proxy/config.yaml +++ b/humane_proxy/config.yaml @@ -200,11 +200,6 @@ safety: # Optional: override the default block message (leave empty to use built-in). block_message: "" - - - - - criminal_intent: # Score threshold for escalation (below this → only log, no webhook). diff --git a/humane_proxy/escalation/router.py b/humane_proxy/escalation/router.py index 92e9af2..53b59fd 100644 --- a/humane_proxy/escalation/router.py +++ b/humane_proxy/escalation/router.py @@ -53,6 +53,27 @@ 🇿🇦 South Africa • SADAG: 0800 567 567 + 🇯🇵 Japan + • Inochi no Denwa: 0120-783-556 + +🇰🇷 South Korea + • Crisis Counseling Hotline: 1393 + +🇫🇷 France + • Numéro National Prévention Suicide: 3114 + +🇪🇸 Spain + • Línea de Atención a conducta suicida: 024 + +🇮🇹 Italy + • Telefono Amico: 800 274 274 + +🇲🇽 Mexico + • SAPTEL: 800 290 0024 + +🇳🇿 New Zealand + • Need to Talk?: 1737 + 🌐 International: • IASP Crisis Centres: https://www.iasp.info/resources/Crisis_Centres/ • Befrienders Worldwide: https://www.befrienders.org diff --git a/tests/test_care_response.py b/tests/test_care_response.py index 2de6b99..51cc531 100644 --- a/tests/test_care_response.py +++ b/tests/test_care_response.py @@ -106,19 +106,19 @@ class TestCareResponseBlockNewCountries: """New country helplines are present in the built-in care response.""" def test_message_contains_japan_resource(self): - assert "0120-783-556" in CARE_RESPONSE_BLOCK or "Inochi" in CARE_RESPONSE_BLOCK + assert "0120-783-556" in CARE_RESPONSE_BLOCK def test_message_contains_south_korea_resource(self): assert "1393" in CARE_RESPONSE_BLOCK def test_message_contains_spain_resource(self): - assert "717 003 717" in CARE_RESPONSE_BLOCK or "Esperanza" in CARE_RESPONSE_BLOCK + assert "024" in CARE_RESPONSE_BLOCK def test_message_contains_italy_resource(self): - assert "Telefono Amico" in CARE_RESPONSE_BLOCK or "02 2327 2327" in CARE_RESPONSE_BLOCK + assert "800 274 274" in CARE_RESPONSE_BLOCK def test_message_contains_mexico_resource(self): - assert "SAPTEL" in CARE_RESPONSE_BLOCK or "5259-8121" in CARE_RESPONSE_BLOCK + assert "800 290 0024" in CARE_RESPONSE_BLOCK def test_message_contains_new_zealand_resource(self): - assert "1737" in CARE_RESPONSE_BLOCK or "Lifeline" in CARE_RESPONSE_BLOCK \ No newline at end of file + assert "1737" in CARE_RESPONSE_BLOCK \ No newline at end of file