Skip to content

Fix: persist multi_content for user messages#1652

Merged
trungutt merged 1 commit intodocker:mainfrom
trungutt:fix/persist-user-message-multi-content
Feb 9, 2026
Merged

Fix: persist multi_content for user messages#1652
trungutt merged 1 commit intodocker:mainfrom
trungutt:fix/persist-user-message-multi-content

Conversation

@trungutt
Copy link
Contributor

@trungutt trungutt commented Feb 9, 2026

Previously, UpdateSession() serialized the entire session.Messages slice - containing MultiContent - as a JSON blob into the messages column. The session manager called UpdateSession() right after adding the user message with its MultiContent, so the full attachment data was persisted.

We changed the way messages were persisted recently. IIUC UpdateSession was changed to only save session metadata (not messages anymore), and a new PersistentRuntime was introduced to persist messages individually by intercepting runtime events. However, the UserMessageEvent struct only carries a Message string field - it does not include MultiContent. 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 MultiContent to UserMessageEvent, attempting to fix the issue.

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.
@trungutt trungutt requested a review from a team as a code owner February 9, 2026 12:15
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

APPROVED - No issues found!

This PR correctly adds MultiContent persistence for user messages. The implementation is clean and complete:

  • Added MultiContent field to UserMessageEvent struct
  • 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.

@trungutt trungutt merged commit 7332db7 into docker:main Feb 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants