Compare commits

...

1 Commits

Author SHA1 Message Date
Alexander Whitestone
22ee463a3d fix: test_none_input should test None, not empty string
The test_none_input test had docstring 'None input should not crash' but
was actually calling detect_crisis('') instead of detect_crisis(None).

Also removes checkCrisis(fullText) from finishStream() - assistant
responses should not trigger client-side crisis detection, only user
input should. Running crisis detection on Timmy's own responses could
cause false positive panel triggers if the AI generates crisis-related
keywords.
2026-04-13 01:59:09 -04:00
2 changed files with 1 additions and 2 deletions

View File

@@ -98,7 +98,7 @@ class TestDetection(unittest.TestCase):
def test_none_input(self): def test_none_input(self):
"""None input should not crash.""" """None input should not crash."""
r = detect_crisis("") r = detect_crisis(None)
self.assertEqual(r.level, "NONE") self.assertEqual(r.level, "NONE")
def test_score_ranges(self): def test_score_ranges(self):

View File

@@ -1199,7 +1199,6 @@ Sovereignty and service always.`;
if (fullText) { if (fullText) {
messages.push({ role: 'assistant', content: fullText }); messages.push({ role: 'assistant', content: fullText });
saveMessages(); saveMessages();
checkCrisis(fullText);
} }
isStreaming = false; isStreaming = false;
sendBtn.disabled = msgInput.value.trim().length === 0; sendBtn.disabled = msgInput.value.trim().length === 0;