Skip to content

feat(search): list_my_activity across connected sources for Search MCP and the Assistant - #10535

Merged
waleedlatif1 merged 13 commits into
stagingfrom
feat/list-my-activity
Dec 1, 2026
Merged

waleedlatif1 merged 13 commits into
stagingfrom
feat/list-my-activity

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • New list_my_activity: the caller's own activity across their connected sources in a date window, newest first. Exposed as a Search MCP tool and an organization Assistant server tool, both calling one use case (listMyActivity, lib/sim-search/live/activity.ts)
  • Live, per-member reads with each person's own connections (no index):
    • Slack: messages sent (from:me), thread replies as replied
    • Gmail: in:sent, replied when the message carries In-Reply-To; To/Cc are collaborators
    • Google Calendar: primary-calendar meetings the member organized or accepted with someone else (attended); declined/unanswered/solo/focus/OOO excluded
    • Jira: issues reported (created) and assigned (assigned, timed by last update, approximateTime)
    • Confluence: pages created/edited (approximate when the last version is someone else's) and comments written (commented, reading the comment's page)
  • Paging instead of silent truncation: streams merge newest first behind a per-stream horizon; a signed cursor carries per-account bounds, so pages have no gaps and a failed source is retried from its own bound
  • Every entry passes the same source-boundary verification as search before it is returned; text is projected through the resolved-secret registry
  • Per-source status: ok | partial | not_connected | reconnect | unsupported | failed (+ reason, retryAfterSeconds); not_connected/reconnect carry connect: { providerId, url } so clients can prompt the member to connect
  • Always the person the principal represents (requirePrincipalSubjectUserId); new operation knowledge.activity.list denies workspace API keys; organization scope only
  • Gated by the new my-activity organization feature flag (MCP tool listed only when on; use case re-checks; my-activity entitlement for Assistant turns)
  • Moves safeContent/candidateFor/verifyCandidates/compareAccounts into live/candidates.ts and shares Gmail/Atlassian date clauses between search and activity

Known limits

  • Jira updatedBy() is not used (no account IDs, unreliable date bounds), so Jira reports created/assigned rather than every edit or comment
  • No Slack mentions: Real-time Search documents no mention syntax
  • Google Drive reports unsupported until activity can resume by page token
  • Calendar reads the window in week slices with at most six requests per call; a week too full to read reports partial
  • Slack replies are detected from thread_ts; without it a reply reads as sent

Dependencies

  • Do not merge before the Organization Search foundation PR widens the organization_search_mcp_invocation.tool_name CHECK to include list_my_activity (this PR only widens the TypeScript union)
  • Mothership companion needs: a list_my_activity Assistant tool gated by ENTITLEMENTS.myActivity (organization runs, like search_people), a retrievalPaths entry (or skip) for list_my_activity in agent-cli/grammar/services.ts since it maps every assistantToolContracts id, myActivity: "my-activity" in ENTITLEMENTS, regenerated contracts, and the sim-sync companion file

Type of Change

  • New feature

Testing

  • activity-page.test.ts: paging returns every entry once and newest first (topK 2 and 10), failed-account retry, no continuation with only failed accounts, stall stop, window/seen filtering, cursor scope and tamper refusal; each goes red with its guard reverted
  • activity-providers.test.ts: Slack reply/sent and file exclusion, Gmail reply and recipient parsing, Calendar attendance filter and order, Confluence approximate edits and comment pages, Jira assigned timing
  • activity.integration.ts (real Postgres): approved-but-unconnected sources reported not_connected with connect hints (unapproved and non-activity sources left out), another member's chat refused, window cap and foreign cursor refused
  • Existing lib/sim-search/live, lib/mothership/chat, lib/knowledge/mcp, lib/mothership/tools suites pass (1,865 tests); bun run lint, bun run generate; full type-check and audits in CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 1, 2026 8:06am UTC

Request Review

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The latest changes appear safe to merge within the PR’s stated rollout dependencies.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge within the PR’s stated rollout dependencies.

Summary

Adds list_my_activity to Search MCP and the organization Assistant through one shared use case.

  • Members can browse their connected-source activity in newest-first pages.
  • Search MCP and the organization Assistant expose the same activity list.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  MCP[Search MCP] --> UseCase[listMyActivity]
  Assistant[Organization Assistant] --> UseCase
  UseCase --> Guards[Check caller and feature flag]
  Guards --> Providers[Read caller's connected sources]
  Providers --> Verify[Check each entry's access]
  Verify --> Merge[Merge entries and sign next cursor]
  Merge --> Result[Items and source status]
Loading

Reviews (12) · Last reviewed commit: "fix(search): give each activity entry it..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 35 files

This PR changes authentication, authorization, or input validation. Ultrareviews find 2.4x more serious bugs than standard reviews. Comment @cubic-dev-ai ultrareview to run one.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/google.ts Resolved
Comment thread apps/sim/lib/sim-search/live/google.ts Resolved
Comment thread apps/sim/lib/sim-search/live/types.ts Resolved
Comment thread apps/sim/lib/sim-search/live/slack.ts Resolved
Comment thread apps/sim/lib/sim-search/live/google.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

3 issues found across 36 files

Confidence score: 3/5

  • atlassian.ts can stop after three pages without reaching the continuation bound; because the cursor stores no page token, the next read repeats those pages and drops older activity. Preserve the Atlassian page token or continue until the bound is reached.
  • activity-page.ts can emit a cursor longer than the 8,000-character input limit, so the next request may reject it. Bound or compact the serialized continuation state.
  • google.ts shares its six-request budget with slice traversal, so a dense Calendar slice can exceed the documented 1,000-meeting cap. Enforce the item limit independently of the request budget.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/sim/lib/sim-search/live/atlassian.ts">

<violation number="1" location="apps/sim/lib/sim-search/live/atlassian.ts:406">
P2: The three-page `readPastEnd` cap can stop before reaching the continuation bound, but the cursor stores no Atlassian page token. Re-reading the same pages leaves the bound unchanged and drops older activity; continue until the bound is crossed or preserve a provider cursor.</violation>
</file>

<file name="apps/sim/lib/sim-search/live/google.ts">

<violation number="1" location="apps/sim/lib/sim-search/live/google.ts:795">
P2: The six-request budget is shared with slice traversal, so one dense Calendar slice can read 1,500 meetings instead of the documented 1,000-meeting cap. Enforce the 1,000-item limit independently of the number of date slices.</violation>
</file>

<file name="apps/sim/lib/sim-search/live/activity-page.ts">

<violation number="1" location="apps/sim/lib/sim-search/live/activity-page.ts:13">
P2: `MAX_SEEN_AT_BOUND` can produce `nextCursor` values longer than the input contract’s 8,000-character limit. Bound or compact the serialized continuation state so every emitted cursor can be accepted by the next request.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/sim-search/live/google.ts Resolved
Comment thread apps/sim/lib/sim-search/live/slack.ts Resolved
Comment thread apps/sim/lib/sim-search/live/google.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 36 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 36 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 36 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the feat/list-my-activity branch from db60cf6 to bbf693c Compare December 1, 2026 07:16
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Comment thread apps/sim/lib/sim-search/live/google.ts Resolved

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 35 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

…P and the Assistant

Reads the caller's own activity live from each connected account: Slack messages
sent and replied, Gmail mail sent and replied, Google Calendar meetings attended,
Jira issues created and assigned, Confluence pages created or edited and comments.
Pages merge newest first behind a per-stream horizon with a signed per-account
cursor, so nothing is dropped between pages; every entry passes the source
boundary check before it is returned. Each source reports ok, partial,
not_connected (with where to connect), reconnect, unsupported or failed.

Gated by the my-activity organization flag.
… and comments

Bounds never move later when an account recovers, a failed account is retried
after a page with progress, Jira and Confluence read past items newer than the
bound, Calendar reads newest week slices first, the window end stays exclusive,
comments keep their own keys, Slack entries carry only the member's message,
saved Assistant answers keep activity citations, and the type and lint gates pass.
…and unsupported sources

A page that returned entries continues even when the remaining bounds stay put,
continuations skip the span check against now, cursors name each account's
source so a disconnected account is reported, an unsupported source filter is
reported, Jira created means creator, and Slack activity requests no file hits.
@waleedlatif1
waleedlatif1 force-pushed the feat/list-my-activity branch from 8abeec1 to 1be33b6 Compare December 1, 2026 07:53
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 35 files

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/knowledge/mcp/server.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 36 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e0278df into staging Dec 1, 2026
85 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 97e292ab Deployed Dec 1, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant