Skip to content

feat(activity): name bots and the system principal instead of "Automation" - #6237

Merged
synoet merged 3 commits into
mainfrom
synoet/activity-actor-attribution-6fe8
Sep 9, 2026
Merged

feat(activity): name bots and the system principal instead of "Automation"#6237
synoet merged 3 commits into
mainfrom
synoet/activity-actor-attribution-6fe8

Conversation

@synoet

@synoet synoet commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

What

Every non-user actor in the activity feed and the entity side panel read Automation. Rows written by the platform now read System, rows by an agent read the bot's name (Macro, Macro Coder, Cursor, or a team bot's name), and the word Automation is gone.

Demo

Before (main) then after (this PR) for a fresh user whose onboarding rows were written by the system principal. main renders 18 Automation rows; this branch renders the same 18 rows as System and document.body.innerText contains no Automation.

a5_attribution_before_after.mp4

How

  • core/actor.ts parses the wire actorId once into { kind: 'user' } | { kind: 'bot' } | { kind: 'unknown' }. bot|<uuid> is the only non-user prefix the backend emits (Actor = ChannelSender).
  • @core/constant/macroSystem.ts mirrors bot_id::MACRO_SYSTEM_BOT_ID (…5759), the principal the backend uses for autonomous platform actions (onboarding seeds and the like). It joins firstPartyBotName in message-sender.ts (renamed from the private systemBotDisplayName and exported), so channels stop showing Bot for it too.
  • ActivityContext gains botName(botId). The app implementation resolves first-party bots from constants immediately and team bots from the bots list once it succeeds (undefined while loading, Bot for unknown ids). The useBotsQuery() subscription is created once per context consumer, lazily under the consumer's owner the first time a team-bot row asks for a name, and reused for every later call; first-party bots and user-only surfaces never create it.
  • createActorName is a ts-pattern table over the parsed actor: viewer You, user via displayName, bot via botName, unknown Unknown.

Tests

  • core/actor.test.ts: user, bot, and raw fallbacks (bot|, macro|no-at-sign, system:nightly).
  • primitives/actor-name.test.ts: viewer, user, system, first-party bot, team bot, loading team bot, unparseable.
  • context/activity-context.test.tsx: two team-bot rows share one useBotsQuery() subscription; a first-party bot never creates it.
  • message-sender.test.ts: the system principal resolves without channel bot data.

Part 3 of the activity feed polish program.

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a275d934-b551-452a-b1b0-d18aa849e8cc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 5d7807c0-3980-4f1e-80ac-726b45af97ec

📥 Commits

Reviewing files that changed from the base of the PR and between 197e815 and 7b0a29f.

📒 Files selected for processing (9)
  • apps/web/src/features/activity/context/activity-context.tsx
  • apps/web/src/features/activity/core/actor.test.ts
  • apps/web/src/features/activity/core/actor.ts
  • apps/web/src/features/activity/primitives/actor-name.test.ts
  • apps/web/src/features/activity/primitives/actor-name.ts
  • apps/web/src/features/activity/tests/mock-context.ts
  • apps/web/src/lib/core/constant/macroSystem.ts
  • apps/web/src/lib/queries/channel/message-sender.ts
  • apps/web/src/lib/queries/channel/tests/message-sender.test.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Summary

Summary by CodeRabbit

  • New Features
    • Activity entries now resolve and display names for users, team bots, first-party bots, and the system actor.
    • The current user is shown as “You,” while unrecognized actors are labeled “Unknown.”
    • Bot names update as team bot information becomes available, with a temporary blank state while loading.
    • Bot and user actors are handled separately for more accurate activity attribution.

Walkthrough

The change adds Actor parsing for users, bots, and unknown identifiers. It adds Macro System bot constants and first-party bot-name resolution. ActivityContext now exposes botName using first-party names and the bots query. createActorName resolves user, bot, system, and unknown actor names with loading fallbacks. Tests cover parsing, name resolution, system bot handling, and mock context behavior.

Merge Risk: ⚪ Minimal · up to 7b0a2

Activity and side-panel rows now show System for platform actions, bot names for bot actions, and user names for user actions, replacing the Automation label. The implemented resolution paths and test coverage support merge readiness.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title uses the required conventional commits format and accurately describes the changes, but it is 74 characters long and exceeds the 72-character limit. Shorten the title to 72 characters or fewer while preserving the conventional commits format and the main change.
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description directly explains the actor-name changes, implementation, and tests covered by the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

@synoet
synoet marked this pull request as ready for review September 7, 2026 00:51
@cursor
cursor Bot force-pushed the synoet/activity-actor-attribution-6fe8 branch 2 times, most recently from dfbd87b to 6085169 Compare September 7, 2026 21:44
cursoragent and others added 2 commits September 9, 2026 02:41
…tion"

Every non-user actor read "Automation". Actor ids are now parsed once into
user / bot / unknown, and names come from a table: the viewer is "You",
users resolve through displayName, the system bot (bot_id 5759) reads
"System", first-party bots read their constant names, team bots resolve
through the bots list, and unparseable ids read "Unknown". The system bot
also joins firstPartyBotName so channels stop showing "Bot" for it.

Co-authored-by: teo <synoet@users.noreply.github.com>
… lazily, instead of per bot row

Co-authored-by: teo <synoet@users.noreply.github.com>
@cursor
cursor Bot force-pushed the synoet/activity-actor-attribution-6fe8 branch from 6085169 to 6d6be1a Compare September 9, 2026 02:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6d6be1a. Configure here.

Comment thread apps/web/src/features/activity/context/activity-context.tsx
…load, not blank

Co-authored-by: teo <synoet@users.noreply.github.com>
@synoet
synoet merged commit 87d1633 into main Sep 9, 2026
25 checks passed
@synoet
synoet deleted the synoet/activity-actor-attribution-6fe8 branch September 9, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants