Skip to content

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

Merged
waleedlatif1 merged 9 commits into
stagingfrom
fix/activity-audit-followups
Dec 1, 2026
Merged

waleedlatif1 merged 9 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:48am 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: 5/5 · The PR appears safe to merge; no new actionable issue was established.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issue was established.

Summary

This PR keeps healthy accounts paging when another account stalls and makes activity labels reflect the member’s own actions.

  • Activity pages let each account keep its own place.
  • Jira and Confluence entries use the member’s own action time.
  • Activity results show clearer actions and fewer duplicate fields.
  • Search MCP charges for the accounts an activity page reads.
  • Calendar weeks cut short by earlier reads can continue later.
  • People search accepts separate filters for directory fields.
  • Chat history defaults to newest first and accepts a wider date window.

All seven supplied previous threads were unnumbered. Their reported issues are addressed in the current code; none needs a duplicate comment.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Check caller and activity window] --> B[Select accounts for this page]
  B --> C[Admit the account cost]
  C -->|Refused| D[Return an error without provider reads]
  C -->|Allowed| E[Read and check each account]
  E --> F[Merge entries newest first]
  F --> G[Stop only blocked accounts]
  F --> H[Keep bounds for continuing accounts]
  G --> I[Return entries and source statuses]
  H --> I
  I --> J[Sign the next cursor when work remains]
Loading

Reviews (6) · Last reviewed commit: "fix(search): declare optional activity w..." · 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
@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.

@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
@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 17 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

…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 f598852 to cc4bda7 Compare December 1, 2026 09:42
@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 17 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 2ffbae6 into staging Dec 1, 2026
85 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/activity-audit-followups branch December 1, 2026 16:53

This branch was previously deployed

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