Files
Jason Cat f00971f906 Fix session restore invariants: fail-closed on corrupted tool rows, redact config secrets, and type getSession errors (#79)
* feat: persist chat sessions securely across restarts

Persist session state to disk with safe recovery and secret redaction so chat can continue after server restart.

Made-with: Cursor

* fix: prevent orphan tool messages after session restore

Ensure restored AIMessage tool_calls are reconstructed and sanitize lc_messages to avoid provider 400 errors.

Made-with: Cursor

* fix: harden tool_calls persistence and restore sequencing

Persist explicit AIMessage tool_calls and enforce block-scoped tool message closure/sanitization so restored sessions avoid orphan-tool protocol violations across providers.

Made-with: Cursor

* fix(session): address review — warn on empty tool_call_id; tighten string secret masking

Made-with: Cursor

* fix(session): return 503 for unreadable state; 404 for missing/mismatch; clarify vs review

Made-with: Cursor

* fix(web): typed HttpError for getSession; 404-only local cleanup; bootstrap retry

Made-with: Cursor

* fix(session): fail-closed restore + redact secrets in persisted config

Made-with: Cursor

* fix(session): address review — tool-safe lc trim, header helper, sent_media_total, 3-state bootstrap

Made-with: Cursor

* Sanitize protocol on lc_messages before merging requests

Added sanitization of protocol on sess.lc_messages before building the merged request list for astream to ensure the structure is always sanitized.
2026-04-09 18:42:55 +08:00
..