ulysses/core
Afonso Coutinho edd5ea36ad
Fix _parse_msg_content corrupting JSON-array-like text messages on reload (#2060)
_parse_msg_content deserializes stored multimodal content (image/audio
blocks) back into a list. It treated ANY string starting with '[{' and
containing the substring "type" as serialized content, requiring only
that each element be a dict — never that "type" be a real content-block
kind. So a plain text message whose content happens to be a JSON array
of typed objects (e.g. a user pasting an API schema sample like
[{"type": "object", ...}]) was silently parsed from str into a list on
the next hydration, destroying the original string. This runs on every
session load from the DB (_db_to_session -> get_session). Restrict the
round-trip to non-empty lists whose every element is a dict whose
"type" is a recognized block kind (text/image/image_url/audio/...);
real multimodal content (verified: document_processor emits exactly
these) still round-trips, JSON-looking text is left untouched.
2026-06-27 14:31:51 +01:00
..
__init__.py Odysseus v1.0 2026-05-31 23:58:26 +09:00
atomic_io.py Add native Windows compatibility layer 2026-06-01 15:09:47 +09:00
auth.py fix(auth): add config lock around migration methods (#4447) 2026-06-26 20:35:11 +02:00
constants.py refactor(constants): single source of truth for data dir (#3368) 2026-06-08 09:58:52 +02:00
database.py feat(paths): abstract runtime path logic for frozen distribution packages (#969) 2026-06-15 17:44:10 +01:00
exceptions.py refactor(exceptions): dedupe src/exceptions via core re-export (#4785) 2026-06-24 16:50:07 +02:00
log_safety.py fix(security): redact credential-bearing URLs and PII from logs (#4750) 2026-06-22 23:12:39 +02:00
middleware.py fix(document): allow render-pdf to be framed and 503 cleanly on missing PyMuPDF (#2103) 2026-06-18 06:25:26 +00:00
models.py fix: session context drifting — messages leaking between chats (#135) (#267) 2026-06-09 14:12:52 +01:00
platform_compat.py fix(platform): read proc version with utf-8 2026-06-11 21:58:22 +01:00
session_manager.py Fix _parse_msg_content corrupting JSON-array-like text messages on reload (#2060) 2026-06-27 14:31:51 +01:00