Use Ai::Conversation::Message directly in GraphQL read
What does this MR do and why?
-
Adds
duo_chat_read_directly_from_db
feature flag to turn on/off the following changes:- Update
ChatStorage#messages
to returnAi::Conversation::Message
. - For
ChatMessagesResolver
, instead ofto_h
every items, passAi::Conversation::Message
directly to GraphQL for serialization - For
Types::Ai::MessageType
, make it able to handle bothChatMessage
andAi::Conversation::Message
.-
id
has to be sourced frommessage_xid
inAi::Conversation::Message
-
thread
has to be routed toobject.thread
instead ofobject['thread']
(this is a quirk of ActiveRecord). -
errors
has to be routed toerror_details
column (sinceerrors
is already reserved internally in ActiveRecord)
-
- For Duo feedback, update message record directly
- Update
-
Other behavior changes not affected by the feature flag
- Polyfill
Ai::Conversation::Message
so it behaves a much likeChatMessage
as possible
- Polyfill
References
How to set up and validate locally
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #501150 (closed)
Edited by Mark Chao