Skip to content

fix(search): let cancelled live reads stop instead of reporting partial coverage - #8359

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/search-discussion-propagate-cancellation
Sep 28, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/search-discussion-propagate-cancellation

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • A cancelled or timed-out live read could resolve as a successful, partially covered document. readDiscussionSection turns every per-section failure into a "could not be fully retrieved" warning, including the caller's abort, so Drive, Linear, and GitHub reads kept going after Stop, a cancelled MCP request, or the 15s read budget
  • readLiveDocument now decides cancellation by the signal's state right after the provider read (signal.throwIfAborted(), before verifyCurrent), as search already does. That covers every abort reason: Copilot Stop's string reasons, custom abort errors, an MCP cancel reason, AbortError, and TimeoutError, on every provider path. Genuine provider failures still degrade to partial coverage
  • Notion: a notion-ai-search result without a type is reported as partial instead of complete; an explicit workspace_search fallback stays complete
  • Linear: backwards (oldest-first) reads validate hasPreviousPage, the flag they actually page on
  • Meeting content and discussion entries are cut with truncateAtCodePoint, so a cut never splits a surrogate pair and the discussion cap is exact

Type of Change

  • Bug fix

Testing

  • readLiveDocument rejects with the exact reason for a string reason, AbortError, and TimeoutError during a Drive discussion read, and a connection reset on the comments request still returns the document with the coverage warning
  • Notion missing-type → partial; Linear backwards read without hasPreviousPage → rejected
  • With staging's sources swapped in, all five new cases fail
  • lib/sim-search suites (303 tests), type-check, lint, and check:audits pass

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • 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 Sep 28, 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 Sep 28, 2026 1:29am 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.

No issues found across 9 files

Confidence score: 5/5

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

Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Fixes cancellation handling in live document reads.

The PR appears safe to merge; no outstanding finding or new actionable issue was identified.

Summary

The PR makes cancelled live reads reject rather than return partial coverage, improves coverage reporting and pagination validation, and avoids splitting Unicode characters when truncating content. The change since the previous review adds a cancellation check after current-scope verification. The earlier cancellation finding is fixed.

Reviews (2) · Last reviewed commit: "fix(search): stop a live read cancelled ..."

@greptile-apps

This comment has been minimized.

@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 Sep 28, 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 9 files

Confidence score: 5/5

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

Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e1124ff into staging Sep 28, 2026
32 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/search-discussion-propagate-cancellation branch September 28, 2026 02:05

This branch was previously deployed

1 inactive deployment
Preview — 8774dba1 Deployed Sep 28, 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.

2 participants