Skip to content

chore(agents): add agent sessions to the activity system - #6367

Open
404Wolf wants to merge 6 commits into
mainfrom
cursor/agent-session-activity-73d3
Open

404Wolf wants to merge 6 commits into
mainfrom
cursor/agent-session-activity-73d3

Conversation

@404Wolf

@404Wolf 404Wolf commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Agent sessions now flow through the shared activity log the same way chats, documents, and channels already do.

Mapping

macro.agent_session_lifecycle events are classified in the agent-session domain (ActivitySource). DSS only consumes the topic:

  • OpenedCreated (owner)
  • TurnStarted with an actor → Messaged on the session
  • TurnStarted with no actor → ignored (runtime / delegated)
  • RenamedEdited
  • DeletedPurge (the session row is gone)
  • TurnEnded, Settled, WaitingForInput, InputReceived, Mentioned, Stopped → ignored

No new durable Action variant. Prompts reuse Messaged. Mentions notify named users; the prompt is already recorded as Messaged.

UI

  • GraphQL AGENT_SESSION and tool agent_session decode as a first-class activity entity
  • Feed rows resolve session name/icon/link from item preview
  • Agent side panel gets an Activity section (Soup opt-in via agentSessionFilter; sessions stay off by default in Soup)
  • Existing tool-count section is renamed This session so it does not collide with id="activity"

Tests

  • cargo test -p agent_session --lib domain::activity --no-default-features — 7 passed
  • Frontend activity decode / entity query / opener / ReadActivity tests passed
  • just check passed
Open in Web Open in Cursor 

cursoragent and others added 4 commits September 11, 2026 21:54
Map macro.agent_session_lifecycle onto the shared activity feed: opened
is created, user prompts are messaged, renamed is edited, and deleted
purges the session. Runtime consequences are ignored. DSS consumes the
topic as wiring only.

Co-authored-by: Wolf Mermelstein <wolf@404wolf.com>
Decode AGENT_SESSION events, resolve names and links from session
previews, query entity timelines via Soup's opt-in agent session
filter, and add an Activity section to the agent side panel.

Co-authored-by: Wolf Mermelstein <wolf@404wolf.com>
Co-authored-by: Wolf Mermelstein <wolf@404wolf.com>
Prompts reuse Messaged, so the rail reads "sent a message" rather than
"prompted".

Co-authored-by: Wolf Mermelstein <wolf@404wolf.com>
@cursor

cursor Bot commented Sep 11, 2026

Copy link
Copy Markdown

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 089e5a4d-7864-49c6-9c90-f7acdd42f08d

📥 Commits

Reviewing files that changed from the base of the PR and between 319eb04 and 66efd07.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock, !**/Cargo.lock
📒 Files selected for processing (23)
  • apps/web/src/features/activity/context/activity-context.test.tsx
  • apps/web/src/features/activity/context/activity-context.tsx
  • apps/web/src/features/activity/core/event.ts
  • apps/web/src/features/activity/primitives/entity-activity.test.ts
  • apps/web/src/features/activity/primitives/entity-activity.ts
  • apps/web/src/features/activity/primitives/entity-opener.test.ts
  • apps/web/src/features/activity/primitives/entity-opener.ts
  • apps/web/src/features/activity/queries/decode.test.ts
  • apps/web/src/features/activity/queries/decode.ts
  • apps/web/src/features/activity/queries/entity-query.test.ts
  • apps/web/src/features/activity/queries/entity-query.ts
  • apps/web/src/features/activity/queries/fixtures.ts
  • apps/web/src/features/activity/views/entity-activity-section.tsx
  • apps/web/src/features/block-agent/component/sidepanel/AgentSidePanelSections.tsx
  • apps/web/src/lib/core/component/AI/component/tool/ReadActivity.test.tsx
  • apps/web/src/lib/core/component/AI/component/tool/ReadActivity.tsx
  • crates/agent_session/Cargo.toml
  • crates/agent_session/src/domain/activity.rs
  • crates/agent_session/src/domain/activity/test.rs
  • crates/agent_session/src/domain/mod.rs
  • docs/AGENT_GUIDE/ai-chat.md
  • services/document_storage_service/Cargo.toml
  • services/document_storage_service/src/service/activity.rs

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


📝 Summary

Summary by CodeRabbit

  • New Features

    • Added activity tracking for agent sessions, including creation, renaming, messages, and deletion.
    • Agent-session activity now appears in the shared activity timeline and the agent side panel under “This session.”
    • Agent-session entries display readable names and can be opened directly.
    • Activity tools now recognize agent sessions while safely handling unsupported entity types.
  • Documentation

    • Updated the Agent sessions guide to describe the side panel sections and activity history.

Walkthrough

The change adds agent-session lifecycle activity ingestion in Rust. It maps session events to created, edited, messaged, purged, or ignored activity results. The web activity system now decodes agent sessions, queries their activity, resolves display names through previews, and renders them in the agent side panel. Tests cover ingestion, query construction, decoding, entity opening, and activity rendering. Documentation describes the updated side panel.

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 66efd

The agent-session activity ingestion, query support, and side-panel rendering changes have no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title uses the conventional commits format with the valid chore(agents): prefix and is 56 characters long. It clearly describes the activity-system changes for agent sessions.
Description check ✅ Passed The description directly explains the backend event mapping, frontend activity support, UI changes, and tests included in the 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 11, 2026

Copy link
Copy Markdown

cursoragent and others added 2 commits September 15, 2026 18:14
Co-authored-by: Wolf Mermelstein <wolf@404wolf.com>
Main added Mentioned and SessionIdentity.audience after this branch
opened. CI merges with main, so the exhaustive ingest match failed to
compile and the activity fixture was missing audience. Mentions notify
named users; TurnStarted already records the prompt as Messaged.

Also drop the duplicate agent_session Cargo.toml entry that the merge
left in document_storage_service (main already depends on it).

Co-authored-by: Wolf Mermelstein <wolf@404wolf.com>
@404Wolf 404Wolf changed the title Add agent sessions to the activity system chore(agents): add agent sessions to the activity system Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants