feat: pass chatbot_is_staff to lc-chatbot widget#3149
feat: pass chatbot_is_staff to lc-chatbot widget#3149dcschreiber wants to merge 2 commits intomasterfrom
Conversation
🧪 CI InsightsHere's what we observed from your CI run for ca4a499. ❌ Job Failures
|
Compute is_sefaria_staff from existing is_moderator and _email fields and pass it as the is-staff attribute on the lc-chatbot web component for Braintrust trace tagging. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
112f92c to
5e5fc04
Compare
| chatbot_version = chatbot_version if is_int(chatbot_version) else None | ||
|
|
||
| # Chatbot props (passed through base_props for ReaderApp) | ||
| is_sefaria_staff = user_data["is_moderator"] or user_data["_email"].endswith("@sefaria.org") |
There was a problem hiding this comment.
this is problematic. we have user definition in the db, and that takes a different logic. if we need another level of moderator, this is what we should do.
There was a problem hiding this comment.
Yes, we do need different logic. Hey, I'm not sure I understand. What do you recommend we do?
There was a problem hiding this comment.
it seems we should use user.is_staff. if for some reason we need something that is not staff or moderator, we should have a new attribute for User
There was a problem hiding this comment.
I see what you mean, although I think this would be cluttering the DB for the wrong reason. Let me go back to Mickey and check what we want to do.
is-staff now handles both settings gear visibility and trace tagging, making is-moderator redundant on the chatbot widget. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
is_chatbot_staff = (user.is_staff OR email @sefaria.org)inbase_propschatbot_is_staffprop through to the<lc-chatbot>web component'sis-staffattributeCompanion PR: Sefaria/ai-chatbot (same branch name) receives and logs this field.
Test plan
is-staffattribute set on the widget🤖 Generated with Claude Code