fix: harden WebUI bugfix sweep

This commit is contained in:
AJV20
2026-05-28 13:38:50 -04:00
parent 5528e2c579
commit 60d4b2d990
12 changed files with 368 additions and 42 deletions

View File

@@ -594,6 +594,8 @@ class Session:
self.truncation_watermark = None
def save(self, touch_updated_at: bool = True, skip_index: bool = False) -> None:
if not is_safe_session_id(self.session_id):
raise ValueError(f"Unsafe session_id {self.session_id!r}; refusing to write outside session store")
# ── #1558 P0 guard ──────────────────────────────────────────────
# Refuse to save a session that was loaded with metadata_only=True.
# Such sessions have messages=[] (it's the whole point of the partial