You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
[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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
readDiscussionSectionturns 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 budgetreadLiveDocumentnow decides cancellation by the signal's state right after the provider read (signal.throwIfAborted(), beforeverifyCurrent), as search already does. That covers every abort reason: Copilot Stop's string reasons, custom abort errors, an MCP cancel reason,AbortError, andTimeoutError, on every provider path. Genuine provider failures still degrade to partial coveragenotion-ai-searchresult without atypeis reported as partial instead of complete; an explicitworkspace_searchfallback stays completehasPreviousPage, the flag they actually page ontruncateAtCodePoint, so a cut never splits a surrogate pair and the discussion cap is exactType of Change
Testing
readLiveDocumentrejects with the exact reason for a string reason,AbortError, andTimeoutErrorduring a Drive discussion read, and a connection reset on the comments request still returns the document with the coverage warninghasPreviousPage→ rejectedlib/sim-searchsuites (303 tests), type-check, lint, andcheck:auditspassChecklist