# Review queue can't render chat message flagged by AI

**URL:** <https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469>\
**Category:** Bug\
**Tags:** chat, ai\
**Created:** [June 15, 2023, 2:35pm UTC](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469 "2023-06-15T14:35:11Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![fracool](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fracool/32/311603_2.png) [@fracool](https://meta.discourse.org/u/fracool)\
**Post date:** [June 15, 2023, 2:35pm UTC](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469/1 "2023-06-15T14:35:11Z")

</div>

Hi, really enjoying these AI modules, thanks a lot for the work put in!

I’ve configured the toxicity module with the detoxify service running locally, and its working for posts, but for DM’s, it will flag bad ones successfully, however when I visit the review/moderation page (the summart “all” page or the “flagged item” page for these messages) I get:

> Server Error  
> while trying to load /review?priority=low&status=pending&sort\_order=score  
> Error code: 500 Internal Server Error

That’s only for comments that get flagged - for posts/topics or mail, I can select the the “Flagged Item” notification and the review/moderation page for that item will display properly.

I’m not sure if this is an edge case or related to the recent upgrade to Discourse (I’m on 3.1.0.beta5 which came out quite recently)

I see two events in the logs when I trigger the 500 error. It looks like there’s a problem fetching the message.

Error in the logs:

> Message
> 
> ```plaintext
> ArgumentError (wrong number of arguments (given 0, expected 1))
> (eval):7:in `_fast_attributes'
> lib/freedom_patches/ams_include_without_root.rb:57:in `include!'
> app/controllers/reviewables_controller.rb:55:in `block in index'
> app/controllers/reviewables_controller.rb:50:in `map!'
> app/controllers/reviewables_controller.rb:50:in `index'
> app/controllers/application_controller.rb:418:in `block in with_resolved_locale'
> app/controllers/application_controller.rb:418:in `with_resolved_locale'
> lib/middleware/omniauth_bypass_middleware.rb:74:in `call'
> lib/content_security_policy/middleware.rb:12:in `call'
> lib/middleware/anonymous_cache.rb:369:in `call'
> config/initializers/100-quiet_logger.rb:20:in `call'
> config/initializers/100-silence_logger.rb:29:in `call'
> lib/middleware/enforce_hostname.rb:24:in `call'
> lib/middleware/request_tracker.rb:228:in `call'
> 
> ```
> 
> Backtrace
> 
> ```plaintext
> plugins/chat/app/models/chat/direct_message_channel.rb:19:in `title'
> active_model_serializers (0.8.4) lib/active_model/serializer.rb:99:in `block in attribute'
> (eval):7:in `_fast_attributes'
> active_model_serializers (0.8.4) lib/active_model/serializer.rb:456:in `attributes'
> active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
> active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
> active_model_serializers (0.8.4) lib/active_model/serializer/associations.rb:200:in `serialize'
> lib/freedom_patches/ams_include_without_root.rb:57:in `include!'
> active_model_serializers (0.8.4) lib/active_model/serializer.rb:368:in `block in include_associations!'
> active_model_serializers (0.8.4) lib/active_model/serializer.rb:367:in `each_key'
> 
> ```

Cheers,  
Fraser

---

_[View the full topic](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469)._
