Exception: Assistant::ConversationDestroyed

Inherits:
StandardError
  • Object
show all
Defined in:
app/services/assistant/conversation_destroyed.rb

Overview

Raised when the conversation row is destroyed out from under an in-flight
AssistantChatWorker turn — the owner deletes the chat (or Daily Focus
cleanup destroys the briefing conversation) while the worker is still
streaming. The next RubyLLM persistence insert (add_message for the
user/tool message, persist_new_message for the blank assistant
placeholder) would otherwise crash on PG::ForeignKeyViolation
(assistant_messages → assistant_conversations, AppSignal #6043).

AssistantConversation guards both insert paths and raises this instead;
AssistantChatWorker rescues it and exits quietly — there is nothing to
persist to and nobody to broadcast to.

Instance Method Summary collapse

Constructor Details

#initialize(message = 'Conversation was destroyed while processing.') ⇒ void

Parameters:

  • message (String) (defaults to: 'Conversation was destroyed while processing.')

    the exception message



19
20
21
# File 'app/services/assistant/conversation_destroyed.rb', line 19

def initialize(message = 'Conversation was destroyed while processing.')
  super
end