fix(search): let cancelled live reads stop instead of reporting partial coverage
Merged
WA
1mo ago+105+105+012345678901234567890123456789-7-7-0123456789
Summary
- A cancelled or timed-out live read could resolve as a successful, partially covered document.
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 budget readLiveDocumentnow 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 coverage- Notion: a
notion-ai-searchresult without atypeis reported as partial instead of complete; an explicitworkspace_searchfallback 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
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 warning- Notion missing-type → partial; Linear backwards read without
hasPreviousPage→ rejected - With staging's sources swapped in, all five new cases fail
lib/sim-searchsuites (303 tests), type-check, lint, andcheck:auditspass
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)