mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-29 09:53:56 +08:00
fix: Resolve production issues — history dir creation and sensor attributes > 16KB
History: - Add defensive os.makedirs in _sync_test_directory_write to ensure directory exists before write test (fixes ERRNO 2 on fresh install) Sensor attributes (fixes Recorder 16KB limit violation): - Reduce conversation_history preview: 3 entries × 256 chars (was 5 × 4096) - Reduce last response/question truncation to 2048 chars (was 4096) - Reduce system_prompt in attributes to 512 chars (was 4096) - Full data remains accessible via ha_text_ai.get_history service
This commit is contained in:
@@ -123,6 +123,7 @@ class HistoryManager:
|
||||
@staticmethod
|
||||
def _sync_test_directory_write(test_file_path: str) -> None:
|
||||
try:
|
||||
os.makedirs(os.path.dirname(test_file_path), mode=0o755, exist_ok=True)
|
||||
with open(test_file_path, "w") as f:
|
||||
f.write("Permission test")
|
||||
os.remove(test_file_path)
|
||||
|
||||
Reference in New Issue
Block a user