Files
hermes-agent/tests
Alexander Whitestone 3e82c2d58f
Some checks failed
Contributor Attribution Check / check-attribution (pull_request) Failing after 37s
Docker Build and Publish / build-and-push (pull_request) Has been skipped
Supply Chain Audit / Scan PR for supply chain risks (pull_request) Successful in 38s
Tests / e2e (pull_request) Successful in 5m15s
Tests / test (pull_request) Failing after 43m27s
fix: multilingual crisis detection patterns (#694)
Expands crisis detection to support 7 languages:
- English (existing, consolidated)
- Spanish: 'quiero morirme', 'me quiero morir', etc.
- French: 'je veux mourir', 'je veux me tuer', etc.
- German: 'ich will sterben', 'ich will mich umbringen', etc.
- Portuguese: 'quero morrer', 'quero me matar', etc.
- Chinese: '我想死', '我不想活了', etc.
- Japanese: '死にたい', '生きたくない', etc.

Each language covers: suicidal_ideation, farewell, despair, self_harm.

Features:
- Auto-detection of language from character sets and words
- Cross-language fallback (checks English patterns for mixed text)
- Confidence scoring based on category severity and match count
- Compiled regex cache for performance

35 tests, all passing.

Closes #694
2026-04-14 21:16:26 -04:00
..