Repository navigation
fix(ai): use actorEmail for isYou in get_activity - #1324
Conversation
userId and actorEmail can diverge (e.g. AI agent activities logged under the session owner's userId but with a distinct actorEmail). The UI identifies actors by actorEmail; isYou now uses the same field so the LLM no longer attributes others' actions to the user. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe activity tool switches actor identification from userId-based comparison to email-based comparison. It imports the users table, queries the current user's email during activity fetching, and uses email equality instead of userId equality to mark actors as "isYou". ChangesActivity Actor Identification by Email
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8dfece6028
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Use userId for human activities (stable across email changes) and actorEmail for AI-generated activities (agents log under a distinct email even when running in the user's session, so userId alone would wrongly say 'you' for agent actions). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Re: Codex P2 — email change regression Addressed in 769ef2b. The
This handles both the original reported bug and preserves correct self-attribution after email changes. |
* fix(ai): use actorEmail for isYou in get_activity userId and actorEmail can diverge (e.g. AI agent activities logged under the session owner's userId but with a distinct actorEmail). The UI identifies actors by actorEmail; isYou now uses the same field so the LLM no longer attributes others' actions to the user. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(ai): preserve isYou across email changes Use userId for human activities (stable across email changes) and actorEmail for AI-generated activities (agents log under a distinct email even when running in the user's session, so userId alone would wrongly say 'you' for agent actions). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
get_activitywas settingisYou: truebased onactivity.userId === userId, butuserId(the session owner FK) andactorEmail(the denormalized actor snapshot) can diverge — most notably when an AI agent runs in the user's session under theiruserIdbut with a distinctactorEmailactorEmaildirectlyactivity.actorEmail === currentUserEmail, consistent with how the UI identifies actorsTest plan
pnpm test:unit🤖 Generated with Claude Code
Summary by CodeRabbit