fix(supervisor): review only finished sources and add an all-time range

Reviews now snapshot only messages in a terminal state (complete or error) and finished tasks, so a reply still streaming when the review starts waits for the next review instead of changing under it. A frozen source that still changes is skipped for that run and left for the next review, replacing the re-review at the latest version and its 200-source cap. The review period picker gains an All time option.
This commit is contained in:
mesalogo
2026-10-10 15:44:14 +08:00
parent ba30852058
commit f2f4c1273e
12 changed files with 121 additions and 68 deletions
+12 -2
View File
@@ -134,7 +134,7 @@ import {
SUBAGENT_PROGRESS_STORAGE_SCHEMA_VERSION
} from './subagent-progress-storage'
export const ASSISTANT_DATABASE_SCHEMA_VERSION = 62
export const ASSISTANT_DATABASE_SCHEMA_VERSION = 63
function withoutHistoricalWorkMode(value: unknown): unknown {
if (!value || typeof value !== 'object' || Array.isArray(value)) return value
@@ -11919,6 +11919,7 @@ export class AssistantDatabase {
database.exec('BEGIN IMMEDIATE')
try {
database.exec(supervisionReviewMigration)
database.exec(supervisionReviewCurrentView)
database.exec('PRAGMA user_version = 47; COMMIT;')
} catch (error) { database.exec('ROLLBACK'); throw error }
}
@@ -12250,6 +12251,15 @@ export class AssistantDatabase {
`)
} catch (error) { database.exec('ROLLBACK'); throw error }
}
if (version.user_version < 63) {
// Reviews read only finished messages and tasks, so a frozen manifest never changes.
database.exec('BEGIN IMMEDIATE')
try {
database.exec('DROP VIEW IF EXISTS supervision_review_current')
database.exec(supervisionReviewCurrentView)
database.exec('PRAGMA user_version = 63; COMMIT;')
} catch (error) { database.exec('ROLLBACK'); throw error }
}
}
supervisionExperiences(): SupervisionExperienceStore {
@@ -12314,7 +12324,7 @@ export class AssistantDatabase {
}
}
import type { ImageOperation } from '../../shared/image-generation-contracts'
import { SupervisionReviewStore, supervisionReviewMigration } from './supervision-review-store'
import { SupervisionReviewStore, supervisionReviewCurrentView, supervisionReviewMigration } from './supervision-review-store'
import { SupervisionStoryStore, supervisionStoriesMigration } from './supervision-stories'
import { SupervisionExperienceStore, supervisionExperiencesMigration } from './supervision-experiences'
import { migrateSupervisionTimeline, placeTimelineEvents, supersedeReextractedEvents, supervisionAttention, timelineCandidates } from './supervision-timeline'