Skip to content

fix(search): keep activity paging and labels truthful under busy sources and failures - #10561

Open
waleedlatif1 wants to merge 6 commits into
stagingfrom
fix/activity-audit-followups
Open

waleedlatif1 wants to merge 6 commits into
stagingfrom
fix/activity-audit-followups

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

Follow-ups to list_my_activity (#10535) from an independent audit.

  • Busy sources no longer end the listing: a stream that has more to read but scanned nothing at or before its bound now stops only its own account, with a status that says why (unreachable, crowded, no_progress, failed_again). Other accounts keep paging. Before, the horizon pinned at that bound, so nothing was ready and every account was reported stalled.
  • Atlassian bounds:
    • Jira's created listing uses relative-minute JQL bounds (created >= "-Nm"), widened by a minute. Jira resolves them without the member's time zone, so no /myself time zone is needed and hidden-profile time zones don't matter.
    • Confluence's REST API exposes no user time zone. CQL bounds use minute wall-clock values shifted by the widest offsets (UTC−12/UTC+14) plus a minute, which holds the instant in any zone; every instant is then checked exactly.
    • readPastEnd is removed.
  • Truthful labels:
    • Jira assigned now means assignee CHANGED TO currentUser() DURING (…), timed by the assignment in the issue's changelog. Issues whose history can't show it are left out and reported partial.
    • Confluence pages are placed at the member's own latest edit in the window. When the last edit is someone else's, it comes from the v2 version history (up to 10 histories, read 5 at a time). Pages the member didn't edit in the window are dropped.
    • Listings whose order isn't the member's action time are read whole (up to 2 provider pages) and ordered locally, so paging by action time never skips an item.
    • Removes the never-emitted mentioned action and approximateTime.
    • Tool descriptions spell out attended (organized or accepted/tentative), the replied heuristic, and that a recovered source can return entries older than the page.
  • Cost: a failed account is retried once (retries on its cursor bound), then reported failed. Search MCP charges one rate-limit operation per account read instead of a flat 2.
  • Agent-friendliness: continuations may change topK, since it left the cursor scope. Assistant items drop the duplicate citationUrl (citations read url). Items drop accountId, which no caller read.
  • Calendar: reports an overfull week only when a slice exhausts the whole request budget. A slice cut short by earlier slices resumes on the next page.

Type of Change

  • Bug fix

Testing

  • activity-page.test.ts: a listing that can't reach its bound stops only its account while the others page through; a failed account is retried once, then reported. Each goes red with its guard reverted.
  • activity-providers.test.ts: a Confluence page is placed at the member's own edit from its history, and pages they didn't edit are dropped; a Jira issue is timed by its assignment, and one without that history is dropped with partial coverage; a busy older Calendar week resumes instead of reading as overfull (red when reverted).
  • activity-paging.integration.ts (real Postgres, fake providers): following nextCursor with topK 2 and 10 returns every item of every account exactly once, newest first. Red with the merge horizon removed.
  • activity.integration.ts, plus the lib/sim-search/live, lib/mothership/chat, lib/knowledge/mcp suites, pass. Full type-check and audits run 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 9:15am UTC

Request Review

@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 15 files

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

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · Fix the extra-charge path before merging so completed account reads cannot escape the rate allowance.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect activity listings across connected providers and their Assistant and Search MCP callers.

Fix the extra-charge path before merging so completed account reads cannot escape the rate allowance.

Findings

  1. P1 Extra reads escape the limit ▶
  2. P2 Failed reads go uncharged ▶

Summary

The PR improves activity paging and ties Jira and Confluence entries to the member’s own actions.

  • One busy or failed account no longer holds back every activity page.
  • Jira and Confluence activity entries use the member’s own action time.
  • Calendar activity can resume a week cut short by earlier weeks.
  • Activity pages accept new page sizes and return cleaner entries.
  • Search MCP charges activity reads according to the accounts it reads.

Reviews (3) · Last reviewed commit: "fix(search): charge Search MCP activity ..." · Reviewed by Greptile

@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 15 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.

Comment thread apps/sim/lib/knowledge/mcp/server.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.

All reported issues were addressed across 17 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/knowledge/mcp/server.ts Resolved
…ces and failures

- Jira reads its created listing with relative-minute bounds and assigned issues by the
  moment of assignment (assignee CHANGED TO currentUser() DURING, from each issue's history)
- Confluence places pages at the member's own latest edit from version history, dropping
  pages they did not edit in the window, and reads listings whose order is not the member's
  action whole; CQL bounds widen by the widest time zone offsets instead of a day
- A listing that cannot reach its bound stops only its own account, with an accurate status
- A failed account is retried once, then reported
- Search MCP charges one rate-limit operation per account read
- Continuations may change topK; Assistant items drop the duplicate citationUrl and items drop accountId
- Calendar reports an overfull week only when a slice exhausts the whole budget
- Removes the never-emitted mentioned action and approximateTime
…ck each item once per window

- A page with no progress stops the accounts pinning the horizon; the others page on
- A failed account the listing ends before retrying is reported
- Confluence pages and Jira assignments are placed at their latest moment in the whole window,
  so a later page never repeats them; an unread version history reports partial coverage
- Confluence comments before the window are left out
- Search MCP charges a continuation by the accounts its cursor still names
@waleedlatif1
waleedlatif1 force-pushed the fix/activity-audit-followups branch from b224e03 to 5f9ea0d Compare December 1, 2026 09:15
@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.

This branch was previously deployed

1 inactive deployment
Preview — 5f9ea0d2 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