mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
fix: auto-naming for 24h time format (#1374)
* fix: auto-naming for 24h time format needs_auto_name() required AM/PM suffix for default frontend-generated names like 'deepseek-v4-flash 17:46:02'. Frontend uses toLocaleTimeString() which outputs 24h format in most locales — so the regex never matched and auto-naming silently skipped. Made AM/PM optional and added re.IGNORECASE for 'am'/'pm'. * test: add regression tests for needs_auto_name (24h + 12h + custom) --------- Co-authored-by: Calculator Dev <dev@calculator.local>
This commit is contained in:
committed by
GitHub
parent
41d2767b30
commit
ec3b8b42ae
@@ -121,7 +121,7 @@ def needs_auto_name(name: str) -> bool:
|
||||
if name.startswith("Chat:") or name == "Chat":
|
||||
return True
|
||||
# Default frontend name: "modelname HH:MM:SS AM/PM"
|
||||
if re.match(r'^.+ \d{1,2}:\d{2}:\d{2}\s*(AM|PM)$', name):
|
||||
if re.match(r"^.+ \d{1,2}:\d{2}:\d{2}(\s*(AM|PM))?$", name, re.IGNORECASE):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user