Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Clément Sirieix <clement.sirieix@mistral.ai>
Co-authored-by: Gauthier Guinet <43207538+Gguinet@users.noreply.github.com>
Co-authored-by: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
Co-authored-by: Michel Thomazo <51709227+michelTho@users.noreply.github.com>
Co-authored-by: Quentin <torroba.q@gmail.com>
Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>
Co-authored-by: Simon Van de Kerckhove <simon.vandekerckhove@mistral.ai>
Co-authored-by: Vincent G <10739306+VinceOPS@users.noreply.github.com>
Co-authored-by: angelapopopo <angele.lenglemetz@mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Mathias Gesbert 2026-03-23 18:45:21 +01:00 committed by GitHub
parent 5103019b01
commit eb580209d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
180 changed files with 11136 additions and 1030 deletions

View file

@ -6,6 +6,7 @@ from pathlib import Path
from typing import TYPE_CHECKING, Any, TypedDict
from vibe.core.types import LLMMessage, SessionMetadata
from vibe.core.utils.io import read_safe
if TYPE_CHECKING:
from vibe.core.config import SessionLoggingConfig
@ -181,7 +182,7 @@ class SessionLoader:
raise ValueError(f"Session metadata not found at {session_dir}")
try:
metadata_content = metadata_path.read_text("utf-8", errors="ignore")
metadata_content = read_safe(metadata_path)
return SessionMetadata.model_validate_json(metadata_content)
except ValueError:
raise
@ -196,8 +197,9 @@ class SessionLoader:
messages_filepath = filepath / MESSAGES_FILENAME
try:
with messages_filepath.open("r", encoding="utf-8", errors="ignore") as f:
content = f.readlines()
content = read_safe(messages_filepath).split("\n")
if content and content[-1] == "":
content.pop()
except Exception as e:
raise ValueError(
f"Error reading session messages at {filepath}: {e}"