-
Notifications
You must be signed in to change notification settings - Fork 2
fix(memory): old Summary message parts fail to deserialize with missing field 'kind' #2257
Copy link
Copy link
Closed
Labels
P3Research — medium-high complexityResearch — medium-high complexitybugSomething isn't workingSomething isn't workingmemoryzeph-memory crate (SQLite)zeph-memory crate (SQLite)
Description
Summary
On agent startup, messages loaded from SQLite that were stored with the old Summary MessagePart schema fail to deserialize with:
WARN zeph_memory::sqlite::messages: failed to deserialize message parts, falling back to empty
role=assistant parts_json=[{"Summary":{"text":"..."}}]
error=missing field 'kind' at line 1 column NNN
Root Cause
A kind field was added to MessagePart::Summary (or a related variant) without a #[serde(default)] attribute, breaking deserialization of messages stored before the change.
Impact
- Affected messages fall back to empty (role=assistant, no content) — effective context loss for older sessions
- No crash — graceful fallback exists
- Observed: 6 messages affected in the CI-223 test DB (stored during CI-219/220 sessions)
- May affect production users upgrading across the schema change
Expected Behavior
Old Summary messages should deserialize correctly (add #[serde(default)] to new fields, or add a DB migration to backfill the kind field).
Reproduction
- Run agent sessions before the schema change (any session storing deferred summaries)
- Upgrade and start a new session on the same DB
- Observe WARN lines at startup during
restored N message(s)
Config
.local/config/testing.toml, SQLite backend, history_limit=50
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P3Research — medium-high complexityResearch — medium-high complexitybugSomething isn't workingSomething isn't workingmemoryzeph-memory crate (SQLite)zeph-memory crate (SQLite)