Skip to content

feat: add crisis helpline numbers for 10 new countries#26

Merged
Vishisht16 merged 6 commits into
Vishisht16:mainfrom
smriti-nyx:feature/expand-crisis-helplines
May 31, 2026
Merged

feat: add crisis helpline numbers for 10 new countries#26
Vishisht16 merged 6 commits into
Vishisht16:mainfrom
smriti-nyx:feature/expand-crisis-helplines

Conversation

@smriti-nyx

Copy link
Copy Markdown
Contributor

Description

Brief description of what this PR does :
Closes #1

Added crisis helpline numbers for 14 countries in humane_proxy/config.yaml block_message:
USA, UK, Canada, Australia, India, Japan, South Korea, Germany, France, Spain, Italy, Mexico, New Zealand, Brazil.

Formatting matches existing style with flag emojis. No existing entries removed.

Type of Change

  • Bug fix
  • [ x] New feature
  • Breaking change
  • Documentation update

Checklist

  • I have read the CONTRIBUTING guide
  • [ x] My code follows the project's style
  • I have added tests for new or changed behaviour
  • All tests pass (pytest tests/ -v)
  • I have updated documentation if needed
  • [x ] Self-harm / safety-related changes have been reviewed for sensitivity

@smriti-nyx smriti-nyx requested a review from Vishisht16 as a code owner May 20, 2026 07:29
@CLAassistant

CLAassistant commented May 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@coderabbitai

coderabbitai Bot commented May 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ad71147e-8f8a-4bf2-8e45-4110bdbea740

📥 Commits

Reviewing files that changed from the base of the PR and between cdb2bdb and 1c7d735.

📒 Files selected for processing (2)
  • humane_proxy/escalation/router.py
  • tests/test_care_response.py
✅ Files skipped from review due to trivial changes (1)
  • humane_proxy/escalation/router.py

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Expanded crisis support resources with helpline information for Japan, South Korea, Spain, Italy, Mexico, New Zealand, and an additional France contact.
  • Tests

    • Added automated tests to validate the new country-specific hotline entries and the France contact.

Walkthrough

Expand the crisis helpline coverage in the default CARE_RESPONSE_BLOCK message by adding self-harm hotline entries for Japan, South Korea, Spain, Italy, Mexico, and New Zealand, then add tests asserting the presence of each country's helpline identifier.

Changes

International Crisis Helpline Expansion

Layer / File(s) Summary
Expand international helplines in CARE_RESPONSE_BLOCK
humane_proxy/escalation/router.py
Insert country-specific crisis helpline entries for Japan, South Korea, Spain, Italy, Mexico, and New Zealand and add an additional France identifier into the CARE_RESPONSE_BLOCK response string.
Add verification tests for new countries
tests/test_care_response.py
Introduce TestCareResponseBlockNewCountries with assertions verifying hotline/resource identifiers for Japan, South Korea, Spain, Italy, Mexico, New Zealand, and France are present in CARE_RESPONSE_BLOCK.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through lines of text so kind,
Six new numbers for those in mind,
From Japan to Mexico, a caring thread,
Tests check each beacon, firmly said,
Small paws, big help — one world, aligned.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add crisis helpline numbers for 10 new countries' clearly summarizes the main feature addition in the PR and is directly related to the changeset.
Description check ✅ Passed The PR description is related to the changeset and provides details about crisis helpline additions for multiple countries with formatting consistency notes.
Linked Issues check ✅ Passed The PR addresses issue #1 by adding verified crisis helpline numbers for multiple countries to CARE_RESPONSE_BLOCK and includes test assertions for the new entries, matching the acceptance criteria.
Out of Scope Changes check ✅ Passed All changes are scoped to expanding crisis helpline coverage: modifications to CARE_RESPONSE_BLOCK in router.py and corresponding test assertions in test_care_response.py, with no unrelated alterations.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@humane_proxy/config.yaml`:
- Around line 202-220: The YAML under the self_harm section has block_message
indented incorrectly causing parse errors; move the block_message key and its
multiline value so that block_message is aligned at the same indentation level
as always_escalate, escalate_threshold, and response_mode within the self_harm
mapping (i.e., unindent the block_message block to match those sibling fields)
so the multiline | block is properly nested under self_harm.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59ab4162-f3a0-42a6-b9c4-012f71cc10f7

📥 Commits

Reviewing files that changed from the base of the PR and between c2e0825 and 3525848.

📒 Files selected for processing (1)
  • humane_proxy/config.yaml

Comment thread humane_proxy/config.yaml Outdated
@Vishisht16

Copy link
Copy Markdown
Owner

@smriti-nyx thanks for your work and apologies for not being active due to exams.

Actually, #1 is an old issue and now, we've kept block_message in humane_proxy/config.yaml as an override.
Can you please revert the change in block_message and keep it as ""? The care helpline addition must be done to CARE_RESPONSE_BLOCK in humane_proxy/escalation/router.py without duplication and assertions must be added for new country numbers in tests/test_care_response.py. Also, a few of those numbers seem to be outdated so please double check them before adding.

You can simply add this change as a new commit to your branch. Thanks for your understanding.

@smriti-nyx

smriti-nyx commented May 24, 2026 via email

Copy link
Copy Markdown
Contributor Author

@smriti-nyx

Copy link
Copy Markdown
Contributor Author

@smriti-nyx thanks for your work and apologies for not being active due to exams.

Actually, #1 is an old issue and now, we've kept block_message in humane_proxy/config.yaml as an override. Can you please revert the change in block_message and keep it as ""? The care helpline addition must be done to CARE_RESPONSE_BLOCK in humane_proxy/escalation/router.py without duplication and assertions must be added for new country numbers in tests/test_care_response.py. Also, a few of those numbers seem to be outdated so please double check them before adding.

You can simply add this change as a new commit to your branch. Thanks for your understanding.

Hi @Vishisht16, I've addressed all the feedback:

  • Reverted block_message to "" in humane_proxy/config.yaml
  • Moved the helpline numbers to CARE_RESPONSE_BLOCK in humane_proxy/escalation/router.py
  • Added assertions for all new countries in tests/test_care_response.py
  • Verified and corrected outdated numbers (Spain, Italy, Mexico)

All 212 tests passing locally. Please let me know if anything needs further changes!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/test_care_response.py`:
- Around line 108-124: Tests like test_message_contains_spain_resource,
test_message_contains_italy_resource, test_message_contains_mexico_resource and
test_message_contains_new_zealand_resource are using permissive `or` checks that
allow provider names to pass; update each of these tests to assert the canonical
numeric helpline token exists in CARE_RESPONSE_BLOCK instead of allowing the
provider name: replace the `or` checks in test_message_contains_spain_resource
(use "717 003 717"), test_message_contains_italy_resource (use "02 2327 2327"),
test_message_contains_mexico_resource (use "5259-8121"), and
test_message_contains_new_zealand_resource (use "1737") so the tests require the
exact phone number string in CARE_RESPONSE_BLOCK.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1bf71fee-a7e8-479c-9baa-63470a1d7d4d

📥 Commits

Reviewing files that changed from the base of the PR and between 3525848 and 44ac11f.

📒 Files selected for processing (2)
  • humane_proxy/config.yaml
  • tests/test_care_response.py

Comment thread tests/test_care_response.py Outdated

@Vishisht16 Vishisht16 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@smriti-nyx you added trailing blank lines in config.yaml, so please reset those.
Also, if you actually changed CARE_RESPONSE_BLOCK in router.py, it wasn't pushed so make sure it's there with the new numbers in the existing formatting.
CodeRabbit flagged your tests too, so also take a look at them. You must assert phone numbers instead of using or with org names,

I hope the next commit will be final.

@smriti-nyx

smriti-nyx commented May 27, 2026 via email

Copy link
Copy Markdown
Contributor Author

@smriti-nyx

Copy link
Copy Markdown
Contributor Author

I have fixed the trailing blank lines in config.yaml, added country helplines to router.py, and updated test assertions to use phone numbers directly. Please review!

@Vishisht16 Vishisht16 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things to update before I approve it:

  1. You only added 7 countries instead of 10, which might've still been fine if you didn't add a duplicate for France. Just add the second number as another bullet in France.
  2. 🇯🇵 Japan has extra indentation so remove that.
  3. You didn't add test for France's second number so add that.
  4. Maintain consistency in the test file: 2 blank lines before class definition and another blank line at end of file.

All very minor changes but do this and we're good to go.

@smriti-nyx

Copy link
Copy Markdown
Contributor Author

I have fixed all requested changes — merged duplicate France entry with both numbers, fixed Japan indentation, added test for France's 3114 number, and fixed test file formatting with 2 blank lines before each class and blank line at end of file.

@Vishisht16 Vishisht16 added gssoc:approved Approved PR under GSSoC'26 level:beginner Beginner level - easy issue or PR type:docs Documentation change type:accessibility Let's include everyone labels May 31, 2026
@Vishisht16 Vishisht16 merged commit aa941ef into Vishisht16:main May 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc:approved Approved PR under GSSoC'26 level:beginner Beginner level - easy issue or PR type:accessibility Let's include everyone type:docs Documentation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Expand International Crisis Helpline Numbers in Default Config

3 participants