diff --git a/CHANGELOG.md b/CHANGELOG.md index a990d204..846048d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ ## [Unreleased] +### Changed + +- Local fallback title generation no longer has a German-only `Session Bilder` special case; it now uses the same generic topic extraction path as other fallback titles. (Refs #3040) + ## [v0.51.152] — 2026-05-28 — Release DX (stage-batch34 — single-PR optional gateway-backed browser chat) ### Added diff --git a/api/streaming.py b/api/streaming.py index 6c70234d..eef1c819 100644 --- a/api/streaming.py +++ b/api/streaming.py @@ -1869,13 +1869,6 @@ def _fallback_title_from_exchange(user_text: str, assistant_text: str) -> Option assistant_text = re.sub(r'\s+', ' ', assistant_text).strip() combined = f"{user_text} {assistant_text}".strip().lower() combined_raw = f"{user_text} {assistant_text}".strip() - source_lang = _detect_title_language(user_text) - - if source_lang == 'de' and 'bilder' in combined and 'session' in combined: - if 'alt' in combined or 'alte' in combined or 'alten' in combined: - return 'Alte Session Bilder' - return 'Session Bilder' - def _contains_latin(text: str) -> bool: return bool(re.search(r'[A-Za-z]', text or '')) diff --git a/tests/test_title_aux_routing.py b/tests/test_title_aux_routing.py index f31418eb..6a2f8aa3 100644 --- a/tests/test_title_aux_routing.py +++ b/tests/test_title_aux_routing.py @@ -253,7 +253,7 @@ class TestGenerateTitleRawViaAuxTimeout(unittest.TestCase): self.assertEqual(status, 'llm_language_mismatch_aux') self.assertEqual(raw_preview, 'Old Session Image Display Issue') - def test_german_fallback_keeps_german_topic_words(self): + def test_german_fallback_uses_generic_topic_extraction_without_literal_override(self): from api.streaming import _fallback_title_from_exchange title = _fallback_title_from_exchange( @@ -261,7 +261,11 @@ class TestGenerateTitleRawViaAuxTimeout(unittest.TestCase): 'Ich prüfe die Rendering- und Attachment-Pfade im WebUI.', ) - self.assertEqual(title, 'Alte Session Bilder') + self.assertIsNotNone(title) + self.assertIsInstance(title, str) + self.assertNotEqual(title, 'Alte Session Bilder') + self.assertNotEqual(title, 'Session Bilder') + self.assertIn('Warum', title) def test_configured_api_key_is_not_sent_to_caller_supplied_route(self): """Regression: title task keys must not leak to explicit fallback routes.