feat: opt-in auto-summarize new downloads in the background (P13a-2)#138
Merged
Conversation
Follow-up to P13a: optionally auto-generate the abstractive summary for a newly downloaded item in the background, default-off, mirroring the `autoTranscribe` precedent. Runs only when text generation is enabled and its model is already downloaded — never triggers a mid-queue fetch. The on-demand "Summarize with AI" on item detail (P13a) works regardless. - Settings: `autoSummarizeOnDownload` (default false) + setter; a toggle in the AI-settings generation card, shown when generation is enabled. - Pure `autoSummaryDecision` (skip / needsModel / summarize) — unit-tested. - Queue: in `_persistCompleted` (after the auto-transcribe block, so a just-built transcript is the source) generate via the existing engine and persist with `updateAiSummary`; post an `ai` success inbox entry, or a one-time "finish setup" nudge when opted in but no model is present. - Tests: decision units + three queue cases (ready→summary+entry, no-model→nudge, generation-off→no-op). No schema change (reuses P13a). - Docs: P13-PLAN P13a-2 card; VERIFICATION P13a-2 checks; BACKLOG note on the queue-decoupled / RAM co-residency deferral. https://claude.ai/code/session_013JoYmLCosYt5tQ8qwdbL1T
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What & why
Follow-up to P13a (your request): optionally auto-generate the abstractive summary for a newly downloaded item in the background — opt-in, default off. Mirrors the established
autoTranscribeprecedent (P12e-3) almost field-for-field, so it's low-risk and consistent. The on-demand "Summarize with AI" on item detail (P13a) keeps working regardless.Key safety property: it runs only when text generation is enabled and its model is already downloaded (
ensureReady, read-only) — it never triggers a surprise mid-queue model fetch.Changes
SettingsModel.autoSummarizeOnDownload(default false) +setAutoSummarizeOnDownload; a toggle in the AI-settings generation card, shown only when generation is enabled.autoSummaryDecision→skip/needsModel/summarize(unit-tested, mirrorstranscribeFallbackAction).queue_controller._persistCompleted): after the auto-transcribe block (so a just-built transcript is the preferred source), for each completed item — gated byautoSummarizeOnDownload && generationEnabled+ the decision — collectgenerate(buildSummaryPrompt(text))and persist viaupdateAiSummary. A per-item failure never fails the download.category: aisuccess entry (summary_$id), or a one-time "Finish setting up summaries" nudge (summary_needs_model) when opted in but no model is downloaded.aiSummary/aiSummaryModelId).[~]), VERIFICATION P13a-2 checks, BACKLOG note.Tests
dart formatclean ·flutter analyzeNo issues ·flutter test773 passed, including the newautoSummaryDecisionunits and three queue cases: enabled+model-ready → summary written +aisuccess entry; enabled+no-model → skip + one nudge to/settings/ai; opted-in-but-generation-disabled → no-op.Honest notes
autoTranscribe: the summary generates inline in_persistCompletedbefore the next download pumps (gated on model-present so it can't stall on a fetch). Generation is heavier than whisper-tiny, so a fuller off-critical-path design — plus the LLM + Cozo HNSW RAM co-residency validation (owed to P13d) — is logged inBACKLOG.mdas a deliberate v1 tradeoff.https://claude.ai/code/session_013JoYmLCosYt5tQ8qwdbL1T
Generated by Claude Code