Load history images via query, not lazy getImages() (WS path)

FixAIService
Shipped
July 17, 2026 at 8:26 AM UTC
Author
Kamo
Commit
c7d0181

**************** runs on the WebSocket path (called from AiChatWebSocketHandler), which is NOT an HTTP request, so open-session-in-view does not apply. Iterating the loaded history and touching msg.getImages() (a LAZY @OneToMany) on those detached entities threw LazyInitializationException ("could not initialize proxy - no Session"), which surfaced to the client as the assistant reply — breaking every AI chat send. Fetch the images with the existing **************** query instead, so they load in their own session. (The HTTP history endpoint keeps working via OSIV.)

All changes

Like what you see shipping?

Every one of these updates lands in your workspace automatically. Start free and watch it grow week after week.

Start Free ForeverView Pricing