From b47f0d3a44efeae4ebd1e3344ea193cd183a2faf Mon Sep 17 00:00:00 2001 From: Jinwoo-H Date: Mon, 14 Sep 2026 20:17:47 -0400 Subject: [PATCH] fix(session-search): only an unread backlog keeps the phase at indexing An armed cadence sweep on a drained index is not a backlog, so it no longer flashes the pane to indexing with nothing due. --- src/main/ai-vault-search/session-search-indexer.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/ai-vault-search/session-search-indexer.ts b/src/main/ai-vault-search/session-search-indexer.ts index 397f501ed40..364647cb164 100644 --- a/src/main/ai-vault-search/session-search-indexer.ts +++ b/src/main/ai-vault-search/session-search-indexer.ts @@ -243,8 +243,8 @@ export class SessionSearchIndexer { /** * `current` is a claim, so it takes all of it: nothing owed a read by a row, - * nothing owed a read that has no row yet, no sweep owed, no row whose last - * read failed, and a whole sweep that finished. `idle` is the other end of it + * nothing owed a read that has no row yet, no row whose last read failed, + * and a whole sweep that finished. `idle` is the other end of it * — an indexer nobody started has not promised to index anything, and calling * that `current` would claim an index nobody built is up to date. */ @@ -260,9 +260,8 @@ export class SessionSearchIndexer { if (this.degradedRoots.length > 0 || counts.failed > 0) { return 'degraded' } - // Work the rows cannot show: a candidate the deadline cut off has no row, - // and an owed sweep has not looked at the machine yet. - if (this.left > 0 || this.sweepNext) { + // Work the rows cannot show: a candidate the deadline cut off has no row. + if (this.left > 0) { return 'indexing' } return counts.due === 0 && this.lastSweepCompletedAt !== null ? 'current' : 'indexing'