This commit is contained in:
nesquena-hermes
2026-05-28 16:09:47 +00:00
3 changed files with 10 additions and 9 deletions
+4
View File
@@ -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
-7
View File
@@ -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 ''))
+6 -2
View File
@@ -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.