Fix: persist multi_content for user messages#1652
Merged
trungutt merged 1 commit intodocker:mainfrom Feb 9, 2026
Merged
Conversation
User message file attachments (multi_content) were not surviving app restarts because UserMessageEvent only carried the text content string. The multi-content data was present in memory but lost when persisted to SQLite via the event handler.
Contributor
There was a problem hiding this comment.
Review Summary
✅ APPROVED - No issues found!
This PR correctly adds MultiContent persistence for user messages. The implementation is clean and complete:
- Added
MultiContentfield toUserMessageEventstruct - Updated
UserMessage()function signature to accept the new parameter - All call sites updated correctly (runtime.go and all test files)
- Proper variadic expansion used in
persistent_runtime.go - All function signatures align correctly
The fix should properly persist attachment data to the database when user messages contain multi-content.
krissetto
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously,
UpdateSession()serialized the entiresession.Messagesslice - containingMultiContent- as a JSON blob into themessagescolumn. The session manager calledUpdateSession()right after adding the user message with itsMultiContent, so the full attachment data was persisted.We changed the way messages were persisted recently. IIUC
UpdateSessionwas changed to only save session metadata (not messages anymore), and a newPersistentRuntimewas introduced to persist messages individually by intercepting runtime events. However, theUserMessageEventstruct only carries aMessagestring field - it does not includeMultiContent. The attachment data is present in the in-memory session (so it works during the active session) but isn't included when written to the database, unfortunately.This PR just added
MultiContenttoUserMessageEvent, attempting to fix the issue.