# תור הסקירה לא מצליח לרנדר הודעת צ'אט שסומנה על ידי AI

**URL:** https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469
**Category:** Bug
**Tags:** chat, ai
**Created:** [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:** 4
**Page:** 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: [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

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [16 ביוני,‏ 2023,‏ 5:39pm UTC](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469/3 "2023-06-16T17:39:31Z")

</div>

Hi @fracool,

I just pushed a fix for this bug:

[https://github.com/discourse/discourse-ai/commit/9e901dbfbf4c26e0b5346f795fb5691985b4a0fb](https://github.com/discourse/discourse-ai/commit/9e901dbfbf4c26e0b5346f795fb5691985b4a0fb)

Everything should work fine after you rebuild your site.

Thanks for letting us know!

---

<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: [16 ביוני,‏ 2023,‏ 6:39pm UTC](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469/4 "2023-06-16T18:39:24Z")

</div>

Much appreciated, that’s working now 😃

---

<div class="post-metadata">

### Author: ![Roman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/roman/32/157504_2.png) [@Roman](https://meta.discourse.org/u/Roman)
#### Post date: [19 ביוני,‏ 2023,‏ 11:00am UTC](https://meta.discourse.org/t/review-queue-cant-render-chat-message-flagged-by-ai/268469/5 "2023-06-19T11:00:05Z")

</div>

This topic was automatically closed after 2 days. New replies are no longer allowed.
