Skip to content

[18.0][FIX] ai_oca_bridge_chatter: post AI replies as Discuss comments - #112

Open
marcelsavegnago wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-imp-ai_oca_bridge_chatter
Open

[18.0][FIX] ai_oca_bridge_chatter: post AI replies as Discuss comments#112
marcelsavegnago wants to merge 1 commit into
OCA:18.0from
Escodoo:18.0-imp-ai_oca_bridge_chatter

Conversation

@marcelsavegnago

Copy link
Copy Markdown
Member

Discuss only draws chat bubbles for mail.mt_comment. Bridge replies defaulted to mail.mt_note, so AI messages rendered as plain text while manually typed bot messages appeared in bubbles.

@OCA-git-bot OCA-git-bot added series:18.0 mod:ai_oca_bridge_chatter Module ai_oca_bridge_chatter labels Sep 1, 2026
@marcelsavegnago
marcelsavegnago marked this pull request as ready for review September 2, 2026 00:13
@marcelsavegnago

Copy link
Copy Markdown
Member Author

ping @etobella

response["author_id"] = self.chatter_user_id.partner_id.id
response["message_type"] = "comment"
body = response.get("body") or ""
body_is_html = bool(response.pop("body_is_html", False))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might break previous installations....

I mean, imagine I was responding with HTML 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. This should be covered now.

Existing bridges that already return HTML as a plain str are detected and converted to Markup before posting, so the HTML is not escaped or wrapped again. Bridges can also explicitly set body_is_html=True.

Plain-text responses remain unchanged, while the message is still posted as mail.mt_comment so Discuss renders it as a chat bubble.

Could you please check the latest changes?

Discuss only draws chat bubbles for mail.mt_comment. Bridge replies
defaulted to mail.mt_note, so AI messages rendered as plain text.
Existing installations already return HTML; posting that as a str
escapes it and the Html field wraps it again. Convert HTML to
Markup and keep mail.mt_comment.
@marcelsavegnago
marcelsavegnago force-pushed the 18.0-imp-ai_oca_bridge_chatter branch from f539a0a to a0c2f60 Compare September 9, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:ai_oca_bridge_chatter Module ai_oca_bridge_chatter series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants