feature/improve chat system messages#438
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdds centralized system-message template constants and two helper functions ( ChangesCentralized system-message emission for chat events
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baseapp_chats/utils.py`:
- Around line 100-103: Titles containing curly braces will cause formatting
errors when inserted into system message templates that are later rendered with
.format(...). In baseapp_chats/utils.py at line 102, escape the braces in
new_title by replacing any { with {{ and any } with }} before passing it to
SYSTEM_MESSAGE_GROUP_RENAMED.replace("{title}", ...). Apply the same escaping
logic in baseapp_chats/graphql/mutations.py at line 189 for the title parameter
passed to SYSTEM_MESSAGE_GROUP_CREATED.replace("{title}", ...).
- Around line 72-98: The functions send_system_message and
send_chatroom_update_system_messages in baseapp_chats/utils.py lack type
annotations for their parameters and return values, which violates the coding
guidelines. Add proper type annotations to all function parameters (room,
content, actor, target, extra_data for send_system_message and room, actor,
new_title, title_changed, image_changed, added_participants,
removed_participants, is_leaving for send_chatroom_update_system_messages) and
their respective return types. Review the codebase to identify the appropriate
types for each parameter based on how these functions are used and what they
return.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2fc251d7-9560-45e4-89fe-d160725ce399
📒 Files selected for processing (3)
baseapp_chats/graphql/mutations.pybaseapp_chats/tests/test_graphql_mutations.pybaseapp_chats/utils.py
Summary by CodeRabbit
BASEAPP_CHATS_ENABLE_SYSTEM_MESSAGESsetting.