fix(webui): preserve cross-session provenance at display persistence (#6379)

* fix(session): bind internal input identity before acceptance

* fix(webui): bind cross-session display writes at persistence boundary

* fix(webui): simplify session messages to current-target display writes

* chore: trim redundant session message comments
This commit is contained in:
chengyongru authored and GitHub committed 2026-10-22 01:24:18 +08:00
1 parent b37a23698d
commit d5cf09d738
7 files changed
+107 -11

No files matched your search

+2 -2
View File
@@ -456,12 +456,12 @@ class SqliteSessionStore:
return project(HistoryReader(db, key, self.path))
def append_history(
self, key: str, facts: list[HistoryFact], *, expected_generation: str,
self, key: str, facts: list[HistoryFact], *, expected_generation: str | None,
) -> None:
encoded = [(fact, fact.encode()) for fact in facts]
with self.transaction() as db:
row = db.execute("SELECT generation FROM sessions WHERE key=?", (key,)).fetchone()
if row is None or row[0] != expected_generation:
if row is None or (expected_generation is not None and row[0] != expected_generation):
raise SessionConflictError("history belongs to a deleted or replaced session")
db.execute("INSERT OR IGNORE INTO history_heads (session_key) VALUES (?)", (key,))
tail = db.execute(