YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context
Rust agentsagiaiai-memoryaudio-recordingcomputer-visionhermeshermes-agentllmlocal-ailocal-firstmachine-learningmcpmultimodalopenclawprivacyrewindscreen-recordingspeech-to-textycombinator
fix(meetings): keep stop and resume states coherent
Louis Beaumont9d6eb80297ef
diff --git a/COVERAGE.md b/COVERAGE.mdindex 748de6545..7c2fc3cfd 100644--- a/COVERAGE.md+++ b/COVERAGE.md@@ -32,15 +32,15 @@ results and `cargo llvm-cov` data on top when judging release confidence.- Mapped suites: 32- Mapped Rust files: 327-- Active test blocks: 3161+- Active test blocks: 3162- Ignored/manual test blocks: 137-- Weighted coverage points: 2595.9+- Weighted coverage points: 2596.6| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 29 | 3025 | 132 | 2533.9 | 21 | 11 | 100% |-| macos | 29 | 3083 | 112 | 2546.3 | 22 | 11 | 100% |-| linux | 25 | 2698 | 105 | 2237.7 | 20 | 11 | 100% |+| windows | 29 | 3026 | 132 | 2534.6 | 21 | 11 | 100% |+| macos | 29 | 3084 | 112 | 2547.0 | 22 | 11 | 100% |+| linux | 25 | 2699 | 105 | 2238.4 | 20 | 11 | 100% |## Refreshdiff --git a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.test.ts b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.test.tsindex 3c5238903..b43133026 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.test.ts+++ b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.test.ts@@ -5,6 +5,7 @@import { describe, expect, it } from "vitest";import {latestSummaryInputAt,+ meetingSummaryPresentation,meetingSummaryFailure,meetingSummaryFailureCopy,meetingSummaryLifecycleFromStatus,@@ -37,17 +38,24 @@ describe("meeting summary lifecycle", () => {meetingSummaryLifecycleFromStatus(status({ state: "running", execution_id: 12 }),),- ).toEqual({ kind: "running", execution: { ...execution, error_type: null, error_message: null } });+ ).toEqual({+ kind: "running",+ execution: { ...execution, error_type: null, error_message: null },+ });expect(meetingSummaryLifecycleFromStatus(- status({ state: "ready", execution_id: 12, execution_status: "completed" }),+ status({+ state: "ready",+ execution_id: 12,+ execution_status: "completed",+ }),).kind,).toBe("completed");- expect(- meetingSummaryLifecycleFromStatus(status({ state: "off" })),- ).toEqual({ kind: "idle" });+ expect(meetingSummaryLifecycleFromStatus(status({ state: "off" }))).toEqual(+ { kind: "idle" },+ );});/// The scheduler claims a run before it can create the execution row, so@@ -61,7 +69,11 @@ describe("meeting summary lifecycle", () => {it("shows queued once the run has a row", () => {expect(meetingSummaryLifecycleFromStatus(- status({ state: "pending", execution_id: 12, execution_status: "queued" }),+ status({+ state: "pending",+ execution_id: 12,+ execution_status: "queued",+ }),).kind,).toBe("queued");});@@ -85,6 +97,123 @@ describe("meeting summary lifecycle", () => {}});+ it("lets live capture win over every stale summary state", () => {+ const lifecycles = [+ { kind: "finalizing" },+ { kind: "queued", execution },+ { kind: "running", execution },+ { kind: "completed", execution },+ { kind: "failed", execution },+ ] as const;++ for (const lifecycle of lifecycles) {+ expect(+ meetingSummaryPresentation({+ isLive: true,+ resuming: false,+ meetingEnded: false,+ summarizing: false,+ lifecycle,+ }),+ ).toEqual({+ lifecycle: { kind: "idle" },+ working: false,+ transitionPhase: null,+ });+ }+ });++ it("suppresses a stale finalizing state while resume is in flight", () => {+ expect(+ meetingSummaryPresentation({+ isLive: false,+ resuming: true,+ meetingEnded: true,+ summarizing: false,+ lifecycle: { kind: "finalizing" },+ }),+ ).toEqual({+ lifecycle: { kind: "idle" },+ working: false,+ transitionPhase: null,+ });+ });++ it("requires a persisted meeting end before showing summary work", () => {+ expect(+ meetingSummaryPresentation({+ isLive: false,+ resuming: false,+ meetingEnded: false,+ summarizing: false,+ lifecycle: { kind: "running", execution },+ }),+ ).toEqual({+ lifecycle: { kind: "idle" },+ working: false,+ transitionPhase: null,+ });+ });++ it("distinguishes transcript finalization from summary writing after stop", () => {+ expect(+ meetingSummaryPresentation({+ isLive: false,+ resuming: false,+ meetingEnded: true,+ summarizing: false,+ lifecycle: { kind: "finalizing" },+ }),+ ).toEqual({+ lifecycle: { kind: "finalizing" },+ working: true,+ transitionPhase: "finalizing",+ });+ expect(+ meetingSummaryPresentation({+ isLive: false,+ resuming: false,+ meetingEnded: true,+ summarizing: false,+ lifecycle: { kind: "queued", execution },+ }),+ ).toEqual({+ lifecycle: { kind: "queued", execution },+ working: true,+ transitionPhase: "writing",+ });+ expect(+ meetingSummaryPresentation({+ isLive: false,+ resuming: false,+ meetingEnded: true,+ summarizing: true,+ lifecycle: { kind: "idle" },+ }),+ ).toEqual({+ lifecycle: { kind: "idle" },+ working: true,+ transitionPhase: "writing",+ });+ });++ it("preserves terminal summary state after a stable stop", () => {+ const completed = { kind: "completed", execution } as const;+ expect(+ meetingSummaryPresentation({+ isLive: false,+ resuming: false,+ meetingEnded: true,+ summarizing: false,+ lifecycle: completed,+ }),+ ).toEqual({+ lifecycle: completed,+ working: false,+ transitionPhase: null,+ });+ });+it("does not claim a terminal state it cannot explain or retry", () => {expect(meetingSummaryLifecycleFromStatus(status({ state: "failed" })),diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.ts b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.tsindex d7f8f10a8..ea04dfb6d 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.ts+++ b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-lifecycle.ts@@ -80,7 +80,9 @@ export function meetingSummaryLifecycleFromStatus(switch (status.state) {case "running":- return execution ? { kind: "running", execution } : { kind: "finalizing" };+ return execution+ ? { kind: "running", execution }+ : { kind: "finalizing" };case "ready":return execution ? { kind: "completed", execution } : { kind: "idle" };case "failed":@@ -105,6 +107,54 @@ export function summaryLifecycleIsWorking();}+export interface MeetingSummaryPresentation {+ lifecycle: MeetingSummaryLifecycle;+ working: boolean;+ transitionPhase: "finalizing" | "writing" | null;+}++/**+ * Resolve the one summary state the meeting workspace is allowed to render.+ *+ * A stop followed by an immediate resume can leave the previous end+ * generation pending in the scheduler while the same meeting row is live+ * again. Capture owns the surface in that state: showing the stale summary+ * transition at the same time made the note say both "finalizing" and+ * "transcribing", and also made the editor read-only during the call.+ */+export function meetingSummaryPresentation({+ isLive,+ resuming,+ meetingEnded,+ summarizing,+ lifecycle,+}: {+ isLive: boolean;+ resuming: boolean;+ meetingEnded: boolean;+ summarizing: boolean;+ lifecycle: MeetingSummaryLifecycle;+}): MeetingSummaryPresentation {+ if (isLive || resuming || !meetingEnded) {+ return {+ lifecycle: { kind: "idle" },+ working: false,+ transitionPhase: null,+ };+ }++ const working = summarizing || summaryLifecycleIsWorking(lifecycle);+ if (!working) {+ return { lifecycle, working: false, transitionPhase: null };+ }++ return {+ lifecycle,+ working: true,+ transitionPhase: lifecycle.kind === "finalizing" ? "finalizing" : "writing",+ };+}+export function latestSummaryInputAt(meetingEnd: string | null,transcriptUpdatedAt: string | null,@@ -144,9 +194,7 @@ export function meetingSummaryFailure(const errorMessage = execution.error_message ?? "";const kind =RUST_ERROR_TYPE_MAP[(execution.error_type ?? "").trim().toLowerCase()] ??- parsePipeError(- `${execution.error_type ?? ""} ${errorMessage}`.trim(),- ).type;+ parsePipeError(`${execution.error_type ?? ""} ${errorMessage}`.trim()).type;const upgrade = parseQuotaUpgradeAction(errorMessage);switch (kind) {diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.test.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.test.tsxindex 7b0b28808..30a58745c 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.test.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.test.tsx@@ -13,19 +13,29 @@ afterEach(cleanup);describe("MeetingSummaryTransition", () => {it("keeps the transcript reachable while the last words are finalized", () => {const onTranscriptToggle = vi.fn();+ const onResume = vi.fn();render(<MeetingSummaryTransitionphase="finalizing"transcriptOpen={false}onTranscriptToggle={onTranscriptToggle}+ onResume={onResume}/>,);- expect(screen.getByRole("status")).toHaveAccessibleName(- "finalizing transcript",- );+ expect(screen.getByRole("status")).toHaveAccessibleName("meeting saved");+ expect(+ screen.getByText(+ "your notes are saved · finishing the transcript before summary · you can safely leave",+ ),+ ).toBeInTheDocument();+ expect(+ screen.queryByTestId("meeting-summary-draft-block"),+ ).not.toBeInTheDocument();fireEvent.click(screen.getByRole("button", { name: "show transcript" }));expect(onTranscriptToggle).toHaveBeenCalledOnce();+ fireEvent.click(screen.getByRole("button", { name: "resume recording" }));+ expect(onResume).toHaveBeenCalledOnce();});it("draws the summary in blocks without replacing transcript access", () => {@@ -44,6 +54,9 @@ describe("MeetingSummaryTransition", () => {expect(screen.getByRole("button", { name: "hide transcript" }),).toHaveAttribute("aria-pressed", "true");+ expect(+ screen.queryByRole("button", { name: "resume recording" }),+ ).not.toBeInTheDocument();});it("leaves no placeholder behind outside an active transition", () => {diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.tsxindex 2d884d376..5cc8aa6b6 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/meeting-summary-transition.tsx@@ -5,7 +5,7 @@import React from "react";import { AnimatePresence, motion, useReducedMotion } from "framer-motion";-import { FileText } from "lucide-react";+import { Check, FileText, Loader2, Play } from "lucide-react";export type MeetingSummaryTransitionPhase = "finalizing" | "writing" | null;@@ -13,6 +13,7 @@ interface MeetingSummaryTransitionProps {phase: MeetingSummaryTransitionPhase;transcriptOpen: boolean;onTranscriptToggle: () => void;+ onResume?: () => void;}const SUMMARY_BLOCKS = [@@ -30,43 +31,53 @@ export function MeetingSummaryTransition({phase,transcriptOpen,onTranscriptToggle,+ onResume,}: MeetingSummaryTransitionProps) {const reduceMotion = useReducedMotion();- const label =- phase === "finalizing" ? "finalizing transcript" : "writing summary";+ const label = phase === "finalizing" ? "meeting saved" : "writing summary";+ const finalizingDetail =+ "your notes are saved · finishing the transcript before summary · you can safely leave";++ // Capture and resume replace the summary transition immediately. Letting+ // AnimatePresence hold the old card for its exit frame briefly recreates+ // the exact contradiction this component exists to prevent.+ if (!phase) return null;return (<AnimatePresence initial={false} mode="wait">- {phase && (- <motion.section- key={phase}- role="status"- aria-live="polite"- aria-label={label}- data-testid="meeting-summary-transition"- initial={reduceMotion ? false : { opacity: 0, y: 10 }}- animate={{ opacity: 1, y: 0 }}- exit={reduceMotion ? undefined : { opacity: 0, y: -6 }}- transition={{ duration: reduceMotion ? 0 : 0.15 }}- className="relative mt-9 overflow-hidden border-l border-foreground/45 py-1 pl-5 pr-1"- >- <div className="mb-6 flex items-center justify-between gap-4">- <div className="flex min-w-0 items-center gap-2 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground">- <motion.span- aria-hidden="true"- className="block h-2 w-2 shrink-0 bg-foreground"- animate={- reduceMotion ? undefined : { opacity: [0.65, 1, 0.65] }- }- transition={{- duration: 1.4,- repeat: reduceMotion ? 0 : Infinity,- ease: "easeInOut",- }}- />- <span>{label}</span>- </div>+ <motion.section+ key={phase}+ role="status"+ aria-live="polite"+ aria-label={label}+ data-testid="meeting-summary-transition"+ initial={reduceMotion ? false : { opacity: 0, y: 10 }}+ animate={{ opacity: 1, y: 0 }}+ exit={reduceMotion ? undefined : { opacity: 0, y: -6 }}+ transition={{ duration: reduceMotion ? 0 : 0.15 }}+ className="relative mt-9 overflow-hidden border-l border-foreground/45 py-1 pl-5 pr-1"+ >+ <div className="mb-6 flex flex-wrap items-center justify-between gap-4">+ <div className="flex min-w-0 items-center gap-2 font-mono text-[10px] uppercase tracking-[0.16em] text-muted-foreground">+ {phase === "finalizing" ? (+ <Check className="h-3 w-3" aria-hidden="true" />+ ) : (+ <Loader2 className="h-3 w-3 animate-spin" aria-hidden="true" />+ )}+ <span>{label}</span>+ </div>+ <div className="flex flex-wrap items-center justify-end gap-2">+ {phase === "finalizing" && onResume ? (+ <button+ type="button"+ onClick={onResume}+ className="inline-flex h-8 shrink-0 items-center gap-2 border border-foreground bg-foreground px-3 font-mono text-[10px] uppercase tracking-[0.12em] text-background transition-colors duration-150 hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-foreground focus-visible:ring-offset-2 focus-visible:ring-offset-background"+ >+ <Play className="h-3 w-3" aria-hidden="true" />+ resume recording+ </button>+ ) : null}<buttontype="button"onClick={onTranscriptToggle}@@ -77,7 +88,13 @@ export function MeetingSummaryTransition({{transcriptOpen ? "hide transcript" : "show transcript"}</button></div>+ </div>+ {phase === "finalizing" ? (+ <p className="max-w-xl pb-2 text-sm leading-6 text-muted-foreground">+ {finalizingDetail}+ </p>+ ) : (<div aria-hidden="true" className="relative max-w-2xl space-y-6 pb-2">{SUMMARY_BLOCKS.map((block, blockIndex) => (<motion.div@@ -102,7 +119,10 @@ export function MeetingSummaryTransition({animate={reduceMotion? undefined- : { scaleX: [0.86, 1, 0.86], opacity: [0.55, 1, 0.55] }+ : {+ scaleX: [0.86, 1, 0.86],+ opacity: [0.55, 1, 0.55],+ }}transition={{duration: 2.2,@@ -125,8 +145,8 @@ export function MeetingSummaryTransition({}}/></div>- </motion.section>- )}+ )}+ </motion.section></AnimatePresence>);}diff --git a/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx b/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsxindex 0bff98ec9..d062a2ef0 100644--- a/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx+++ b/apps/screenpipe-app-tauri/components/meeting-notes/note-view.tsx@@ -142,6 +142,7 @@ import {meetingSummaryFailure,meetingSummaryFailureCopy,meetingSummaryLifecycleFromStatus,+ meetingSummaryPresentation,summaryLifecycleIsWorking,SUMMARY_ACTIVE_POLL_MS,SUMMARY_IDLE_POLL_MS,@@ -311,7 +312,11 @@ export function NoteView({const rootRef = useRef<HTMLDivElement>(null);const [isDraggingImage, setIsDraggingImage] = useState(false);const canSummarizeMeeting =- !isLive && !stopping && !savingBeforeStop && Boolean(meeting.meeting_end);+ !isLive &&+ !resuming &&+ !stopping &&+ !savingBeforeStop &&+ Boolean(meeting.meeting_end);const shareArtifact = useMemo(() =>createMeetingShareArtifact({@@ -346,20 +351,25 @@ export function NoteView({}, [oneTapSend, toast]);const summaryPipeSlug = settings.meetingSummaryPipeSlug || "meeting-summary";- const summaryWorking =- summarizing ||- summaryLifecycle.kind === "finalizing" ||- summaryLifecycle.kind === "queued" ||- summaryLifecycle.kind === "running";+ const summaryPresentation = meetingSummaryPresentation({+ isLive,+ resuming,+ meetingEnded: Boolean(meeting.meeting_end),+ summarizing,+ lifecycle: summaryLifecycle,+ });+ const visibleSummaryLifecycle = summaryPresentation.lifecycle;+ const summaryWorking = summaryPresentation.working;const retranscriptionSummaryRefreshWorking =transcriptRefreshRequested === true &&!summarizing &&- (summaryLifecycle.kind === "finalizing" ||- summaryLifecycle.kind === "queued" ||- summaryLifecycle.kind === "running");+ (visibleSummaryLifecycle.kind === "finalizing" ||+ visibleSummaryLifecycle.kind === "queued" ||+ visibleSummaryLifecycle.kind === "running");const summaryExecutionId =- summaryLifecycle.kind === "queued" || summaryLifecycle.kind === "running"- ? summaryLifecycle.execution.id+ visibleSummaryLifecycle.kind === "queued" ||+ visibleSummaryLifecycle.kind === "running"+ ? visibleSummaryLifecycle.execution.id: null;const summaryExecutionIdRef = useRef<number | null>(summaryExecutionId);summaryExecutionIdRef.current = summaryExecutionId;@@ -371,6 +381,14 @@ export function NoteView({executionId: number;markdown: string;} | null>(null);+ useEffect(() => {+ if (!isLive) return;+ // A resumed meeting starts a new end generation. Forget presentation+ // state retained from the prior stop so it cannot flash again when this+ // generation eventually ends and the first fresh status poll is pending.+ setSummaryLifecycle({ kind: "idle" });+ setRenderedSummaryStream(null);+ }, [isLive, meeting.id]);const streamedSummary =summaryExecutionId != null &&renderedSummaryStream?.pipeSlug === summaryPipeSlug &&@@ -1466,16 +1484,20 @@ export function NoteView({detail: "notes and transcript save automatically",};}- if (summaryLifecycle.kind === "finalizing") {+ if (resuming) {return {- title: "finalizing transcript",- detail: "your meeting is saved · summary will start automatically",+ title: "resuming meeting",+ detail: "reopening this note for live capture",};}- if (- summaryLifecycle.kind === "queued" ||- summaryLifecycle.kind === "running"- ) {+ if (summaryPresentation.transitionPhase === "finalizing") {+ return {+ title: "meeting saved",+ detail:+ "finishing the transcript before summary · you can safely leave",+ };+ }+ if (summaryWorking) {return {title: retranscriptionSummaryRefreshWorking? "refreshing summary"@@ -1485,16 +1507,16 @@ export function NoteView({: "you can leave · it appears here live and saves when finished",};}- if (summaryLifecycle.kind === "completed") {+ if (visibleSummaryLifecycle.kind === "completed") {return {title: "summary ready",detail: "saved to this meeting note",};}- if (summaryLifecycle.kind === "failed") {+ if (visibleSummaryLifecycle.kind === "failed") {return {title: "summary needs attention",- detail: meetingSummaryFailure(summaryLifecycle.execution).copy,+ detail: meetingSummaryFailure(visibleSummaryLifecycle.execution).copy,};}return {@@ -1506,8 +1528,8 @@ export function NoteView({};})();const summaryUpgrade =- summaryLifecycle.kind === "failed"- ? meetingSummaryFailure(summaryLifecycle.execution).upgrade+ visibleSummaryLifecycle.kind === "failed"+ ? meetingSummaryFailure(visibleSummaryLifecycle.execution).upgrade: null;// Whether the footer has anything to report. A finished meeting that is not// recording, summarizing or failing has no news, and the badge plus detail@@ -1515,9 +1537,10 @@ export function NoteView({// summaryWorking already covers finalizing, queued and running.const footerHasNews =isLive ||+ resuming ||summaryWorking ||hasSaveStatus ||- summaryLifecycle.kind === "failed";+ visibleSummaryLifecycle.kind === "failed";// The footer exists to report something. A finished meeting that is not// recording, summarizing, failing or saving has nothing to report, and its// resting caption ("meeting saved") was pure reassurance, so the whole bar@@ -1533,43 +1556,48 @@ export function NoteView({: "summarizing meeting": !canSummarizeMeeting? "summary unavailable"- : summaryLifecycle.kind === "completed" ||+ : visibleSummaryLifecycle.kind === "completed" ||(transcriptRefreshRequested !== null &&(transcriptRefreshRequested === false ||autoSummaryEnabled !== true))? "summarize again"- : summaryLifecycle.kind === "failed"+ : visibleSummaryLifecycle.kind === "failed"? "retry summary": "summarize meeting";const stopActionLabel =stopping || savingBeforeStop? "stopping meeting"- : autoSummaryEnabled === false- ? "stop meeting"- : "stop and summarize";- const summaryTransitionPhase = summaryWorking- ? summaryLifecycle.kind === "finalizing"- ? "finalizing"- : "writing"- : null;+ : autoSummaryEnabled === true+ ? "stop and summarize"+ : "stop meeting";+ const stopButtonLabel =+ stopping || savingBeforeStop+ ? "stopping…"+ : autoSummaryEnabled === true+ ? "stop & summarize"+ : "stop";+ const summaryTransitionPhase = summaryPresentation.transitionPhase;// Share only what is finished and on disk. A half-streamed summary would put// a truncated one in someone's inbox.const canShareSummary =- Boolean(extractMeetingSummary(note)) && !summaryWorking;+ Boolean(extractMeetingSummary(note)) &&+ !isLive &&+ !resuming &&+ !summaryWorking;// A dot on a tab means "this needs you". A summary that finished normally// does not, and leaving the dot lit forever on every summarized meeting is// what teaches people to stop reading dots. Only in-flight work and failures// earn one.const summaryTabState = summaryWorking? "working"- : summaryLifecycle.kind === "failed"+ : visibleSummaryLifecycle.kind === "failed"? "attention": null;const summarySurfaceState = summaryWorking? "working"- : summaryLifecycle.kind === "completed"+ : visibleSummaryLifecycle.kind === "completed"? "ready"- : summaryLifecycle.kind === "failed"+ : visibleSummaryLifecycle.kind === "failed"? "attention": "idle";@@ -1582,7 +1610,7 @@ export function NoteView({// One menu with labelled groups means "it is in the menu" is a complete// instruction. Summarize loses its square here but keeps the prominent// button inside the summary tab, next to the output it produces.- const meetingMenuGroups: MeetingMenuGroup[] = isLive+ const meetingMenuGroups: MeetingMenuGroup[] = isLive || resuming? []: [{@@ -1593,8 +1621,8 @@ export function NoteView({label: summaryActionLabel,icon: summaryWorking? Loader2- : summaryLifecycle.kind === "completed" ||- summaryLifecycle.kind === "failed"+ : visibleSummaryLifecycle.kind === "completed" ||+ visibleSummaryLifecycle.kind === "failed"? RefreshCw: Sparkles,onSelect: () => handleSummaryAction(),@@ -1862,6 +1890,7 @@ export function NoteView({phase={summaryTransitionPhase}transcriptOpen={transcriptOpen}onTranscriptToggle={() => setTranscriptOpen((open) => !open)}+ onResume={() => void onResume()}/></div></section>@@ -1972,12 +2001,13 @@ export function NoteView({isLive && captureState?.severity === "warning"? "bg-amber-500/15 text-amber-700 dark:text-amber-300": isLive ||- summaryLifecycle.kind === "finalizing" ||- summaryLifecycle.kind === "queued" ||- summaryLifecycle.kind === "running" ||- summaryLifecycle.kind === "completed"+ resuming ||+ visibleSummaryLifecycle.kind === "finalizing" ||+ visibleSummaryLifecycle.kind === "queued" ||+ visibleSummaryLifecycle.kind === "running" ||+ visibleSummaryLifecycle.kind === "completed"? "border-foreground bg-foreground text-background"- : summaryLifecycle.kind === "failed"+ : visibleSummaryLifecycle.kind === "failed"? "bg-amber-500/15 text-amber-700 dark:text-amber-300": "bg-muted text-muted-foreground",)}@@ -1992,11 +2022,15 @@ export function NoteView({maxAudioDeviceLevel(audioStatusDevices),)}/>+ ) : resuming ? (+ <Loader2 className="h-4 w-4 animate-spin" />+ ) : visibleSummaryLifecycle.kind === "finalizing" ? (+ <Check className="h-4 w-4" />) : summaryWorking ? (<Loader2 className="h-4 w-4 animate-spin" />- ) : summaryLifecycle.kind === "completed" ? (+ ) : visibleSummaryLifecycle.kind === "completed" ? (<Sparkles className="h-4 w-4" />- ) : summaryLifecycle.kind === "failed" ? (+ ) : visibleSummaryLifecycle.kind === "failed" ? (<AlertTriangle className="h-4 w-4" />) : (<Check className="h-4 w-4" />@@ -2067,13 +2101,14 @@ export function NoteView({onClick={() => void handleStopClick()}disabled={stopping || savingBeforeStop}aria-label={stopActionLabel}- className="h-9 w-9 rounded-none p-0 disabled:border-border disabled:bg-muted/40 disabled:text-muted-foreground disabled:opacity-100"+ className="h-9 gap-2 rounded-none px-3 font-mono text-[10px] uppercase tracking-[0.1em] disabled:border-border disabled:bg-muted/40 disabled:text-muted-foreground disabled:opacity-100">{stopping || savingBeforeStop ? (<Loader2 className="h-3.5 w-3.5 animate-spin" />) : (<Square className="h-3.5 w-3.5" />)}+ <span>{stopButtonLabel}</span></Button></MeetingControlTooltip>)}diff --git a/apps/screenpipe-app-tauri/e2e/COVERAGE.md b/apps/screenpipe-app-tauri/e2e/COVERAGE.mdindex ca1b01f6d..8d344e56d 100644--- a/apps/screenpipe-app-tauri/e2e/COVERAGE.md+++ b/apps/screenpipe-app-tauri/e2e/COVERAGE.md@@ -170,7 +170,7 @@ pass/fail/skip counts.| meeting-overlay-pin.spec.ts | macos | real-ui-e2e, local-api, tauri-command, os-integration | meeting-notes, meeting-overlay-stream, shortcut-overlay | medium | partial | real-user-flow | 1 | Pins the native macOS live-transcript card against a real started meeting: it opens on hover, stays visible after the pointer leaves, and the authoritative stop edge hides it and clears the pin, asserted on the AppKit panel's observed visibility. Hover and the pin toggle are driven through the controller entry points the tracking area and pin button use, because AppKit delivers no synthetic hover to a nonactivating panel. The Windows/Linux reminder webview renders the sign-in gate under E2E seeds, so that surface is covered by component tests instead. || meeting-overlay-stream.spec.ts | windows, macos, linux | local-api, tauri-command | meeting-notes, meeting-overlay-stream | high | strong | mixed | 1 | Starts a real isolated meeting, verifies bounded snapshot plus deterministic delta/final transcript frames, and proves the stream clears on the authoritative stop edge. || meeting-restart-live-transcription.spec.ts | windows, macos, linux | real-ui-e2e, local-api | meeting-notes | high | strong | command | 1 | Opens an auto-detected meeting, runs the full stop_screenpipe/spawn_screenpipe restart the health overlay's RESTART button uses, and asserts the meeting is still open afterwards so live transcription has something to reattach to. |-| meeting-summary-recovery.spec.ts | windows, macos, linux | real-ui-e2e, local-api | meeting-notes, meeting-summary-recovery | high | strong | real-user-flow | 1 | Seeds an ended meeting through the isolated API and verifies persistent saved-audio retranscription, its replacement warning, and completed-summary rerun without launching hosted AI. |+| meeting-summary-recovery.spec.ts | windows, macos, linux | real-ui-e2e, local-api | meeting-notes, meeting-summary-recovery | high | strong | real-user-flow | 1 | Runs an ended meeting through real Stop -> Resume -> Stop transitions in the isolated desktop, holds both mutations to prove their pending receipts, reconciles a delayed stale started event, and captures saved-finalizing, transcript, resumed-live, writing, ready, and failed summary states without launching hosted AI. || meeting-workspace-tabs.spec.ts | windows, macos, linux | real-ui-e2e, local-api | meeting-notes | high | strong | real-user-flow | 1 | Seeds a meeting with notes and summary, switches persistent tabs, resizes to 640x560, checks footer separation and horizontal overflow, then captures a review screenshot. || meetings-only-audio-lifecycle.spec.ts | windows, macos | audio-device, local-api, real-ui-e2e | meetings-only-audio-lifecycle, audio-device-health | high | conditional | real-user-flow | 1 | Opt-in real-audio lifecycle lane: configured devices stay closed outside meetings and open only across a manual meeting edge. || notification-viewer-link.spec.ts | windows, macos, linux | notifications, local-api, window-lifecycle | notifications, viewer-deeplink | high | partial | mixed | 3 | Notification local file links rewrite into in-app viewer links. |diff --git a/apps/screenpipe-app-tauri/e2e/coverage-map.json b/apps/screenpipe-app-tauri/e2e/coverage-map.jsonindex 9f2eedef6..dadb501d3 100644--- a/apps/screenpipe-app-tauri/e2e/coverage-map.json+++ b/apps/screenpipe-app-tauri/e2e/coverage-map.json@@ -1730,7 +1730,7 @@"criticality": "high","confidence": "strong","ux": "real-user-flow",- "notes": "Seeds an ended meeting through the isolated API and verifies persistent saved-audio retranscription, its replacement warning, and completed-summary rerun without launching hosted AI."+ "notes": "Runs an ended meeting through real Stop -> Resume -> Stop transitions in the isolated desktop, holds both mutations to prove their pending receipts, reconciles a delayed stale started event, and captures saved-finalizing, transcript, resumed-live, writing, ready, and failed summary states without launching hosted AI."},{"spec": "meeting-workspace-tabs.spec.ts",diff --git a/apps/screenpipe-app-tauri/e2e/specs/meeting-summary-recovery.spec.ts b/apps/screenpipe-app-tauri/e2e/specs/meeting-summary-recovery.spec.tsindex 83a30c820..e172381d6 100644--- a/apps/screenpipe-app-tauri/e2e/specs/meeting-summary-recovery.spec.ts+++ b/apps/screenpipe-app-tauri/e2e/specs/meeting-summary-recovery.spec.ts@@ -5,21 +5,16 @@/*** Meeting-summary recovery regression.*- * Exercises the user-visible half of the resume/retranscribe bug with a real- * isolated desktop and local meeting API. The summary execution response is- * intercepted so the test is deterministic and never spends hosted-AI quota.- * Manual reruns must remain in the meeting workspace and use the same tracked- * background execution contract as automatic summaries.+ * Exercises Stop -> Resume -> Stop through the real isolated desktop and local+ * meeting API. Summary status is deterministic so every user-visible phase can+ * be asserted and captured without hosted-AI quota.*/-import { existsSync, readFileSync, readdirSync, rmSync } from "node:fs";-import { join } from "node:path";import {authHeaders,getLocalApiConfig,type LocalApiConfig,} from "../helpers/api-utils.js";-import { E2E_DATA_DIR } from "../helpers/app-launcher.js";import { saveScreenshot } from "../helpers/screenshot-utils.js";import { invokeOrThrow } from "../helpers/tauri.js";import {@@ -33,63 +28,49 @@ const TITLE = `e2e summary recovery ${Date.now()}`;const FIXTURE_END_MS = Date.now() - 60_000;const FIXTURE_START = new Date(FIXTURE_END_MS - 30 * 60_000).toISOString();const FIXTURE_END = new Date(FIXTURE_END_MS).toISOString();-const SUMMARY_STARTED = new Date(FIXTURE_END_MS + 1_000).toISOString();const EARLY_TRANSCRIPT_MARKER = "E2E-MEETING-EARLY-SEGMENT-R7K2";const LATE_TRANSCRIPT_MARKER = "E2E-MEETING-LATE-SEGMENT-P9M4";-const TRANSCRIPT_CALLS_KEY = "e2eMeetingSummaryTranscriptCalls";-const CHATS_DIR = join(E2E_DATA_DIR, "chats");-interface StoredChatMessage {- role?: string;- content?: string;+interface SummaryStatusFixture {+ state: "off" | "idle" | "pending" | "running" | "ready" | "failed";+ auto_summary_enabled: boolean;+ execution_id?: number | null;+ execution_status?: string | null;+ error_type?: string | null;+ error_message?: string | null;}-function summaryMarkerChats(): Array<{- name: string;- userContent: string;-}> {- let names: string[];- try {- names = readdirSync(CHATS_DIR);- } catch {- return [];- }-- return names.flatMap((name) => {- if (!name.endsWith(".json")) return [];- try {- const raw = readFileSync(join(CHATS_DIR, name), "utf8");- if (- !raw.includes(EARLY_TRANSCRIPT_MARKER) ||- !raw.includes(LATE_TRANSCRIPT_MARKER)- ) {- return [];+async function setSummaryStatusFixture(+ status: SummaryStatusFixture,+): Promise<void> {+ await browser.execute((nextStatus: SummaryStatusFixture) => {+ (+ window as typeof window & {+ __meetingSummaryRecoverySummaryStatus?: SummaryStatusFixture;}- const conversation = JSON.parse(raw) as {- messages?: StoredChatMessage[];- };- const userContent =- conversation.messages?.find(- (message) =>- message.role === "user" &&- message.content?.includes(EARLY_TRANSCRIPT_MARKER) &&- message.content?.includes(LATE_TRANSCRIPT_MARKER),- )?.content ?? "";- return userContent ? [{ name, userContent }] : [];- } catch {- return [];- }- });+ ).__meetingSummaryRecoverySummaryStatus = nextStatus;+ }, status);}-function cleanupSummaryMarkerChats(): void {- for (const { name } of summaryMarkerChats()) {- try {- rmSync(join(CHATS_DIR, name));- } catch {- // A concurrent atomic replacement can make the old name disappear.- }- }+async function waitForVisibleCopy(+ copy: string,+ timeout = 15_000,+): Promise<void> {+ await browser.waitUntil(+ async () =>+ await browser.execute(+ (expected: string) =>+ document.body.innerText+ .toLowerCase()+ .includes(expected.toLowerCase()),+ copy,+ ),+ {+ timeout: t(timeout),+ interval: 200,+ timeoutMsg: `visible copy did not appear: ${copy}`,+ },+ );}async function apiRequest<T>(@@ -194,12 +175,31 @@ describe("meeting summary recovery controls", function () {let cfg: LocalApiConfig;let meetingId = 0;+ let summaryPipeWasEnabled = true;+ let summaryPipeConfigured = false;before(async () => {await waitForAppReady();cfg = await getLocalApiConfig();await ensureLocalApi(cfg);- cleanupSummaryMarkerChats();+ const pipe = await apiRequest<{+ data?: { config?: { enabled?: boolean } };+ }>(cfg, "/pipes/meeting-summary");+ summaryPipeWasEnabled = pipe.data?.config?.enabled !== false;+ const disabled = await apiRequest<{ success?: boolean; error?: string }>(+ cfg,+ "/pipes/meeting-summary/enable",+ {+ method: "POST",+ body: JSON.stringify({ enabled: false }),+ },+ );+ if (disabled.success !== true) {+ throw new Error(+ `failed to disable isolated summary pipe: ${disabled.error}`,+ );+ }+ summaryPipeConfigured = true;const started = await apiRequest<{ id: number }>(cfg, "/meetings/start", {method: "POST",@@ -242,14 +242,28 @@ describe("meeting summary recovery controls", function () {const original = (window as typeof window & {__meetingSummaryRecoveryFetch?: typeof window.fetch;- __meetingSummaryRecoveryRetranscribeCalls?: number;+ __meetingSummaryRecoverySummaryStatus?: SummaryStatusFixture;+ __meetingSummaryRecoveryHoldStart?: boolean;+ __meetingSummaryRecoveryHoldStop?: boolean;+ __meetingSummaryRecoveryReleaseStart?: () => void;+ __meetingSummaryRecoveryReleaseStop?: () => void;}).__meetingSummaryRecoveryFetch;if (original) window.fetch = original;- sessionStorage.removeItem("e2eMeetingSummaryTranscriptCalls");+ const ownedWindow = window as typeof window & Record<string, unknown>;+ delete ownedWindow.__meetingSummaryRecoverySummaryStatus;+ delete ownedWindow.__meetingSummaryRecoveryHoldStart;+ delete ownedWindow.__meetingSummaryRecoveryHoldStop;+ delete ownedWindow.__meetingSummaryRecoveryReleaseStart;+ delete ownedWindow.__meetingSummaryRecoveryReleaseStop;}).catch(() => undefined);- cleanupSummaryMarkerChats();+ if (summaryPipeConfigured) {+ await apiRequest(cfg, "/pipes/meeting-summary/enable", {+ method: "POST",+ body: JSON.stringify({ enabled: summaryPipeWasEnabled }),+ }).catch(() => undefined);+ }if (meetingId) {await apiRequest(cfg, `/meetings/${meetingId}`, {method: "DELETE",@@ -257,7 +271,7 @@ describe("meeting summary recovery controls", function () {}});- it("keeps retranscribe in the footer and lets a completed summary run again", async () => {+ it("keeps recovery controls and one coherent state through stop and resume", async () => {const meetingsNav = await waitForTestId("nav-meetings", 25_000);if ((await meetingsNav.getAttribute("aria-current")) === "page") {// The preceding meeting-note spec can leave this shared app process on@@ -293,99 +307,62 @@ describe("meeting summary recovery controls", function () {await browser.execute((targetMeetingId: number,- startedAt: string,earlyCapturedAt: string,lateCapturedAt: string,earlyMarker: string,lateMarker: string,- transcriptCallsKey: string,) => {const ownedWindow = window as typeof window & {__meetingSummaryRecoveryFetch?: typeof window.fetch;- __meetingSummaryRecoveryRetranscribeCalls?: number;- __meetingSummaryRecoveryRunBody?: unknown;+ __meetingSummaryRecoverySummaryStatus?: SummaryStatusFixture;+ __meetingSummaryRecoveryHoldStart?: boolean;+ __meetingSummaryRecoveryHoldStop?: boolean;+ __meetingSummaryRecoveryReleaseStart?: () => void;+ __meetingSummaryRecoveryReleaseStop?: () => void;};const original = window.fetch.bind(window);- let transcriptReplacedAt: string | null = null;- let manualSummaryStartedAt: string | null = null;- let manualSummaryPolls = 0;ownedWindow.__meetingSummaryRecoveryFetch = original;- ownedWindow.__meetingSummaryRecoveryRetranscribeCalls = 0;- sessionStorage.setItem(transcriptCallsKey, "0");window.fetch = (input: RequestInfo | URL, init?: RequestInit) => {const url = String(input);- if (- url.includes("/pipes/meeting-summary/run") &&- init?.method === "POST"- ) {- manualSummaryStartedAt = new Date().toISOString();- manualSummaryPolls = 0;- ownedWindow.__meetingSummaryRecoveryRunBody = JSON.parse(- String(init.body ?? "{}"),- );+ if (url.includes(`/meetings/${targetMeetingId}/summary-status`)) {+ const fallbackStatus: SummaryStatusFixture = {+ state: "ready",+ auto_summary_enabled: true,+ execution_id: 987654,+ execution_status: "completed",+ };return Promise.resolve(- Response.json({ success: true, execution_id: 987655 }),- );- }- if (url.includes("/pipes/meeting-summary/executions?")) {- const manualExecution = manualSummaryStartedAt- ? {- id: 987655,- status: manualSummaryPolls++ === 0 ? "running" : "completed",- started_at: manualSummaryStartedAt,- trigger_event: "meeting_ended",- trigger_key: String(targetMeetingId),- }- : null;- return Promise.resolve(- new Response(- JSON.stringify({- data: [- ...(manualExecution ? [manualExecution] : []),- {- id: 987654,- status: "completed",- started_at: startedAt,- trigger_event: "meeting_ended",- trigger_key: String(targetMeetingId),- },- ],- }),- {- status: 200,- headers: { "Content-Type": "application/json" },- },+ Response.json(+ ownedWindow.__meetingSummaryRecoverySummaryStatus ??+ fallbackStatus,),);}if (- url.includes(`/meetings/${targetMeetingId}/retranscribe`) &&- init?.method === "POST"+ url.includes("/meetings/start") &&+ init?.method === "POST" &&+ ownedWindow.__meetingSummaryRecoveryHoldStart) {- const transcriptUpdatedAt = new Date().toISOString();- transcriptReplacedAt = transcriptUpdatedAt;- ownedWindow.__meetingSummaryRecoveryRetranscribeCalls =- (ownedWindow.__meetingSummaryRecoveryRetranscribeCalls ?? 0) + 1;- return Promise.resolve(- new Response(- JSON.stringify({- meeting_id: targetMeetingId,- batches_processed: 1,- transcript_updated_at: transcriptUpdatedAt,- summary_refresh_event_emitted: false,- }),- {- status: 200,- headers: { "Content-Type": "application/json" },- },- ),- );+ return new Promise<Response>((resolve, reject) => {+ ownedWindow.__meetingSummaryRecoveryReleaseStart = () => {+ ownedWindow.__meetingSummaryRecoveryHoldStart = false;+ void original(input, init).then(resolve, reject);+ };+ });+ }+ if (+ url.includes("/meetings/stop") &&+ init?.method === "POST" &&+ ownedWindow.__meetingSummaryRecoveryHoldStop+ ) {+ return new Promise<Response>((resolve, reject) => {+ ownedWindow.__meetingSummaryRecoveryReleaseStop = () => {+ ownedWindow.__meetingSummaryRecoveryHoldStop = false;+ void original(input, init).then(resolve, reject);+ };+ });}if (url.includes(`/meetings/${targetMeetingId}/transcript`)) {- const calls = Number(- sessionStorage.getItem(transcriptCallsKey) ?? 0,- );- sessionStorage.setItem(transcriptCallsKey, String(calls + 1));const segment = (id: number,transcript: string,@@ -406,7 +383,7 @@ describe("meeting summary recovery controls", function () {speakerName: "speaker",transcript,capturedAt,- createdAt: transcriptReplacedAt ?? capturedAt,+ createdAt: capturedAt,});return Promise.resolve(new Response(@@ -444,12 +421,10 @@ describe("meeting summary recovery controls", function () {};},meetingId,- SUMMARY_STARTED,new Date(Date.parse(FIXTURE_START) + 10_000).toISOString(),new Date(Date.parse(FIXTURE_END) - 10_000).toISOString(),EARLY_TRANSCRIPT_MARKER,LATE_TRANSCRIPT_MARKER,- TRANSCRIPT_CALLS_KEY,);const row = await $(@@ -457,164 +432,142 @@ describe("meeting summary recovery controls", function () {);await row.waitForExist({ timeout: t(25_000) });await row.click();+ await waitForTestId("note-editor", 20_000);// The start and direct-update fixture operations intentionally avoid a// real stop event. Synchronize the already-verified idle backend state// through the same event Home consumes after a native meeting toggle so a// delayed start notification cannot leave this saved row looking live.+ // Wait for that delayed notification first; clearing before it arrives+ // lets its 10-second optimistic grace window immediately overwrite idle.+ await waitForVisibleCopy("ongoing", 10_000).catch(() => undefined);await syncMeetingIdleState();- await waitForTestId("note-editor", 20_000);-- const retranscribe = await $(- 'button[aria-label="retranscribe saved audio"]',- );- await retranscribe.waitForDisplayed({ timeout: t(15_000) });- expect(await retranscribe.isEnabled()).toBe(true);-- const rerun = await $('button[aria-label="summarize again"]');- await rerun.waitForDisplayed({ timeout: t(15_000) });- expect(await rerun.isEnabled()).toBe(true);-- await browser.waitUntil(- async () => {- const openDialog = await $('[role="alertdialog"]');- if (await openDialog.isDisplayed().catch(() => false)) return true;- try {- const currentRetranscribe = await $(- 'button[aria-label="retranscribe saved audio"]',- );- if (!(await currentRetranscribe.isEnabled())) return false;- await currentRetranscribe.click();- await browser.pause(100);- return await (- await $('[role="alertdialog"]')- )- .isDisplayed()- .catch(() => false);- } catch {- // The meeting status refresh can replace the control between lookup- // and click on WebKit. Retry with a fresh element handle.- return false;- }- },- {- timeout: t(10_000),- interval: 250,- timeoutMsg: "retranscribe confirmation did not open",- },- );- const dialog = await $('[role="alertdialog"]');- const dialogCopy = (await dialog.getText()).toLowerCase();- expect(dialogCopy).toContain("rebuild the transcript from saved audio");- expect(dialogCopy).toContain("replaces the current transcript");- await dialog.$("button=retranscribe").click();-await browser.waitUntil(async () =>- (await browser.execute(- () =>- (- window as typeof window & {- __meetingSummaryRecoveryRetranscribeCalls?: number;- }- ).__meetingSummaryRecoveryRetranscribeCalls ?? 0,- )) === 1,+ !(await browser.execute(() =>+ document.body.innerText.toLowerCase().includes("ongoing"),+ )),{timeout: t(10_000),interval: 100,- timeoutMsg: "retranscribe confirmation did not POST to the meeting API",- },- );- await browser.waitUntil(- async () =>- await browser.execute(() =>- Array.from(document.querySelectorAll('[data-state="open"]')).some(- (element) =>- element.textContent- ?.toLowerCase()- .includes("transcript refreshed"),- ),- ),- {- timeout: t(10_000),- interval: 100,- timeoutMsg: "successful retranscription toast did not appear",- },- );- const toastText = await browser.execute(() =>- Array.from(document.querySelectorAll('[data-state="open"]'))- .map((element) => element.textContent ?? "")- .join(" "),- );- expect(toastText.toLowerCase()).toContain(- "use summarize again to update the note",- );- await browser.waitUntil(- async () =>- (await $("footer").getText()).toLowerCase().includes("meeting saved"),- {- timeout: t(15_000),- interval: 250,- timeoutMsg:- "failed summary-refresh dispatch still promised an automatic summary",+ timeoutMsg: "meeting workspace did not reconcile to the saved row",},);- const screenshot = await saveScreenshot(- "meeting-summary-recovery-controls",+ // Visual state contract. These screenshots are intentionally generated+ // from the real desktop shell and isolated local API, while only the+ // summary execution response is deterministic. Together they prove that+ // one flow never presents two contradictory states.+ const notesTab = await $(+ '[role="tab"][aria-controls="meeting-panel-notes"]',);- expect(existsSync(screenshot)).toBe(true);+ await notesTab.click();+ await setSummaryStatusFixture({+ state: "pending",+ auto_summary_enabled: true,+ });+ await waitForVisibleCopy("you can safely leave", 20_000);+ await saveScreenshot("meeting-summary-01-saved-finalizing");- const transcriptCallsBeforeSummary = await browser.execute(- (key: string) => Number(sessionStorage.getItem(key) ?? 0),- TRANSCRIPT_CALLS_KEY,- );- const refreshedRerun = await $('button[aria-label="summarize again"]');- await refreshedRerun.waitForDisplayed({ timeout: t(15_000) });- const meetingUrl = await browser.getUrl();- await refreshedRerun.click();+ const showTranscript = await $("button=show transcript");+ await showTranscript.click();await browser.waitUntil(- async () => {- const selectedTab = await $('[role="tab"][aria-selected="true"]');- return (await selectedTab.getText()).toLowerCase().includes("summary");- },+ async () =>+ (await $(+ '[role="tab"][aria-controls="meeting-panel-transcript"]',+ ).getAttribute("aria-selected")) === "true",{timeout: t(10_000),interval: 100,- timeoutMsg: "manual summary did not stay in the meeting Summary tab",+ timeoutMsg: "transcript tab did not open from saved receipt",},);- expect(await browser.getUrl()).toBe(meetingUrl);- expect(await browser.getUrl()).toContain("section=meetings");- const runBody = await browser.execute(- () =>- (- window as typeof window & {- __meetingSummaryRecoveryRunBody?: unknown;- }- ).__meetingSummaryRecoveryRunBody,- );- // meeting_end round-trips through the backend, which serialises UTC as- // "+00:00" where the fixture's toISOString() writes "Z". Same instant,- // different spelling, so compare the instant: pinning the string fails on- // the serialiser rather than on the rerun payload being right. The key- // checks stay, so an extra or renamed field still fails here.- const summaryRun = runBody as {- meeting_summary: { meeting_id: number; meeting_end: string };- };- expect(Object.keys(summaryRun)).toEqual(["meeting_summary"]);- expect(Object.keys(summaryRun.meeting_summary).sort()).toEqual([- "meeting_end",- "meeting_id",- ]);- expect(summaryRun.meeting_summary.meeting_id).toBe(meetingId);- expect(Date.parse(summaryRun.meeting_summary.meeting_end)).toBe(- Date.parse(FIXTURE_END),+ await saveScreenshot("meeting-summary-02-finalizing-transcript");+ await notesTab.click();++ await browser.execute(() => {+ (+ window as typeof window & {+ __meetingSummaryRecoveryHoldStart?: boolean;+ }+ ).__meetingSummaryRecoveryHoldStart = true;+ });+ await $("button=resume recording").click();+ await waitForVisibleCopy("resuming meeting");+ expect(+ await $("[data-testid=meeting-summary-transition]").isExisting(),+ ).toBe(false);+ await saveScreenshot("meeting-summary-03-resume-pending");++ await browser.execute(() => {+ (+ window as typeof window & {+ __meetingSummaryRecoveryReleaseStart?: () => void;+ }+ ).__meetingSummaryRecoveryReleaseStart?.();+ });+ const stopAndSummarize = await $('button[aria-label="stop and summarize"]');+ await stopAndSummarize.waitForDisplayed({ timeout: t(15_000) });+ await waitForVisibleCopy("notes and transcript save automatically");+ expect(+ await $("[data-testid=meeting-summary-transition]").isExisting(),+ ).toBe(false);+ await saveScreenshot("meeting-summary-04-resumed-live");++ await browser.execute(() => {+ (+ window as typeof window & {+ __meetingSummaryRecoveryHoldStop?: boolean;+ }+ ).__meetingSummaryRecoveryHoldStop = true;+ });+ await stopAndSummarize.click();+ await waitForVisibleCopy("stopping…");+ await saveScreenshot("meeting-summary-05-stop-pending");+ // Install the next authoritative answer before releasing the real stop.+ // Otherwise the isolated scheduler can fail its no-key run before the+ // note's first post-stop status poll, racing the visual state under test.+ await setSummaryStatusFixture({+ state: "running",+ auto_summary_enabled: true,+ execution_id: 987656,+ execution_status: "running",+ });+ await browser.execute(() => {+ (+ window as typeof window & {+ __meetingSummaryRecoveryReleaseStop?: () => void;+ }+ ).__meetingSummaryRecoveryReleaseStop?.();+ });+ const refreshedNotesTab = await $(+ '[role="tab"][aria-controls="meeting-panel-notes"]',);- const transcriptCallsAfterSummary = await browser.execute(- (key: string) => Number(sessionStorage.getItem(key) ?? 0),- TRANSCRIPT_CALLS_KEY,+ await refreshedNotesTab.click();+ await waitForVisibleCopy("writing summary", 20_000);+ await saveScreenshot("meeting-summary-06-writing");++ await setSummaryStatusFixture({+ state: "ready",+ auto_summary_enabled: true,+ execution_id: 987656,+ execution_status: "completed",+ });+ const summaryTab = await $(+ '[role="tab"][aria-controls="meeting-panel-summary"]',);- expect(transcriptCallsAfterSummary).toBe(transcriptCallsBeforeSummary);- expect(summaryMarkerChats()).toHaveLength(0);+ await summaryTab.click();+ await waitForVisibleCopy("saved to this meeting note");+ await saveScreenshot("meeting-summary-07-ready");++ await setSummaryStatusFixture({+ state: "failed",+ auto_summary_enabled: true,+ execution_id: 987657,+ execution_status: "failed",+ error_type: "unknown",+ error_message: "summary service unavailable",+ });+ await waitForVisibleCopy("summary needs attention", 20_000);+ await saveScreenshot("meeting-summary-08-failed");});});diff --git a/crates/screenpipe-engine/src/routes/meeting_summary_status.rs b/crates/screenpipe-engine/src/routes/meeting_summary_status.rsindex 89a4b485a..85609561a 100644--- a/crates/screenpipe-engine/src/routes/meeting_summary_status.rs+++ b/crates/screenpipe-engine/src/routes/meeting_summary_status.rs@@ -96,6 +96,12 @@ fn state_for_execution(status: &str) -> SummaryState {/// Decide what the note should show. Pure, so every branch is unit tested.pub fn resolve_summary_state(inputs: &SummaryStatusInputs<'_>) -> SummaryState {+ // Reopening the row starts a new end generation. Any execution or claim+ // still visible belongs to an older stop and must not make a live meeting+ // look as though it is being summarized while capture is active.+ if inputs.meeting_end.is_none() {+ return SummaryState::Idle;+ }// Facts before policy. `Summarize again` runs through the same trigger, so// a real run must report its real state even when the automatic trigger is// off. `auto_summary_enabled` is reported separately for the copy that@@ -106,10 +112,6 @@ pub fn resolve_summary_state(inputs: &SummaryStatusInputs<'_>) -> SummaryState {if !inputs.auto_summary_enabled {return SummaryState::Off;}- // A live meeting has no summary input yet; the trigger fires on end.- if inputs.meeting_end.is_none() {- return SummaryState::Idle;- }// The scheduler committed to a run before it could create the row.if inputs.claimed {return SummaryState::Pending;@@ -178,6 +180,25 @@ mod tests {assert_eq!(resolve_summary_state(&i), SummaryState::Idle);}+ #[test]+ fn a_reopened_live_meeting_hides_prior_generation_execution() {+ for status in ["queued", "running", "completed", "failed"] {+ let execution = ExecutionSnapshot {+ id: 7,+ status: status.into(),+ };+ let mut i = inputs(Some(&execution));+ i.meeting_end = None;+ i.latest_input_at = None;+ i.claimed = true;+ assert_eq!(+ resolve_summary_state(&i),+ SummaryState::Idle,+ "stale {status} execution must not override live capture"+ );+ }+ }+#[test]fn execution_status_drives_the_state() {for (status, expected) in [diff --git a/crates/screenpipe-engine/src/routes/meetings.rs b/crates/screenpipe-engine/src/routes/meetings.rsindex b4fa7d194..58e21d013 100644--- a/crates/screenpipe-engine/src/routes/meetings.rs+++ b/crates/screenpipe-engine/src/routes/meetings.rs@@ -520,11 +520,19 @@ pub(crate) async fn get_meeting_summary_status_handler((None, end) => end,};- let found = latest_summary_execution(&state.db, &pipe, id, latest_input_at).await;- let claimed = if found.is_some() {- false+ // A reopened row is a new live generation. Do not attach an execution+ // from the prior stop to an idle response: clients should receive one+ // coherent state, and the stale run remains queryable in Pipe history.+ let (found, claimed) = if meeting_end.is_some() {+ let found = latest_summary_execution(&state.db, &pipe, id, latest_input_at).await;+ let claimed = if found.is_some() {+ false+ } else {+ summary_run_claimed(&state.db, &pipe, id, latest_input_at).await+ };+ (found, claimed)} else {- summary_run_claimed(&state.db, &pipe, id, latest_input_at).await+ (None, false)};let execution = found.as_ref().map(|(snapshot, _, _)| snapshot);diff --git a/docs/coverage/CORE.md b/docs/coverage/CORE.mdindex 84038c738..d71ac47b2 100644--- a/docs/coverage/CORE.md+++ b/docs/coverage/CORE.md@@ -9,10 +9,10 @@ confidence, and criticality.- Tracked crates: screenpipe-engine, screenpipe-db, screenpipe-sqlite-coordinator, screenpipe-audio, screenpipe-screen, screenpipe-a11y- Mapped suites: 32- Mapped Rust files: 327-- Active test blocks: 3161+- Active test blocks: 3162- Ignored/manual test blocks: 137-- Declared test blocks: 3298-- Weighted coverage points: 2595.9+- Declared test blocks: 3299+- Weighted coverage points: 2596.6Confidence weights: strong=1.0, partial=0.7, conditional=0.4, smoke=0.3.Criticality weights: high=1.0, medium=0.7, low=0.4.@@ -23,15 +23,15 @@ are explicitly enabled in a runtime lane.| Platform | Suites | Active tests | Ignored tests | Weighted points | Layers | Flows | Critical score || --- | --- | --- | --- | --- | --- | --- | --- |-| windows | 29 | 3025 | 132 | 2533.9 | 21 | 11 | 100% |-| macos | 29 | 3083 | 112 | 2546.3 | 22 | 11 | 100% |-| linux | 25 | 2698 | 105 | 2237.7 | 20 | 11 | 100% |+| windows | 29 | 3026 | 132 | 2534.6 | 21 | 11 | 100% |+| macos | 29 | 3084 | 112 | 2547.0 | 22 | 11 | 100% |+| linux | 25 | 2699 | 105 | 2238.4 | 20 | 11 | 100% |## Crate Summary| Crate | Suites | Integration files | Source unit files | Active tests | Ignored tests | Weighted points | Flows || --- | --- | --- | --- | --- | --- | --- | --- |-| screenpipe-engine | 10 | 19 | 106 | 1514 | 42 | 1159.6 | 10 |+| screenpipe-engine | 10 | 19 | 106 | 1515 | 42 | 1160.3 | 10 || screenpipe-db | 5 | 52 | 15 | 450 | 16 | 427.2 | 9 || screenpipe-sqlite-coordinator | 1 | 0 | 2 | 16 | 0 | 16.0 | 2 || screenpipe-audio | 6 | 25 | 51 | 591 | 43 | 517.4 | 5 |@@ -68,8 +68,8 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| database | 6 suites / 369 active / 12 ignored / 346.2 pts | 6 suites / 369 active / 12 ignored / 346.2 pts | 6 suites / 369 active / 12 ignored / 346.2 pts || db-search | 2 suites / 111 active / 9 ignored / 111.0 pts | 2 suites / 111 active / 9 ignored / 111.0 pts | 2 suites / 111 active / 9 ignored / 111.0 pts || engine-lifecycle | 6 suites / 208 active / 1 ignored / 183.6 pts | 6 suites / 208 active / 1 ignored / 183.6 pts | 5 suites / 202 active / 1 ignored / 181.9 pts |-| local-api | 2 suites / 352 active / 9 ignored / 248.2 pts | 2 suites / 352 active / 9 ignored / 248.2 pts | 2 suites / 352 active / 9 ignored / 248.2 pts |-| meeting | 6 suites / 1450 active / 19 ignored / 1184.2 pts | 6 suites / 1450 active / 19 ignored / 1184.2 pts | 4 suites / 1159 active / 15 ignored / 915.7 pts |+| local-api | 2 suites / 353 active / 9 ignored / 248.9 pts | 2 suites / 353 active / 9 ignored / 248.9 pts | 2 suites / 353 active / 9 ignored / 248.9 pts |+| meeting | 6 suites / 1451 active / 19 ignored / 1184.9 pts | 6 suites / 1451 active / 19 ignored / 1184.9 pts | 4 suites / 1160 active / 15 ignored / 916.4 pts || ocr | 4 suites / 124 active / 7 ignored / 118.3 pts | 4 suites / 128 active / 7 ignored / 123.8 pts | 3 suites / 119 active / 6 ignored / 114.8 pts || os-integration | 1 suites / 6 active / 0 ignored / 1.7 pts | 1 suites / 6 active / 0 ignored / 1.7 pts | - || performance | 13 suites / 1412 active / 67 ignored / 1241.5 pts | 14 suites / 1515 active / 70 ignored / 1282.7 pts | 13 suites / 1412 active / 67 ignored / 1241.5 pts |@@ -79,8 +79,8 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| speaker | 2 suites / 348 active / 8 ignored / 348.0 pts | 2 suites / 348 active / 8 ignored / 348.0 pts | 2 suites / 348 active / 8 ignored / 348.0 pts || storage | 3 suites / 505 active / 29 ignored / 406.9 pts | 3 suites / 505 active / 29 ignored / 406.9 pts | 3 suites / 505 active / 29 ignored / 406.9 pts || sync | 1 suites / 465 active / 3 ignored / 325.5 pts | 1 suites / 465 active / 3 ignored / 325.5 pts | 1 suites / 465 active / 3 ignored / 325.5 pts |-| timeline | 4 suites / 997 active / 33 ignored / 806.5 pts | 4 suites / 997 active / 33 ignored / 806.5 pts | 4 suites / 997 active / 33 ignored / 806.5 pts |-| transcription | 5 suites / 725 active / 40 ignored / 570.1 pts | 5 suites / 725 active / 40 ignored / 570.1 pts | 5 suites / 725 active / 40 ignored / 570.1 pts |+| timeline | 4 suites / 998 active / 33 ignored / 807.2 pts | 4 suites / 998 active / 33 ignored / 807.2 pts | 4 suites / 998 active / 33 ignored / 807.2 pts |+| transcription | 5 suites / 726 active / 40 ignored / 570.8 pts | 5 suites / 726 active / 40 ignored / 570.8 pts | 5 suites / 726 active / 40 ignored / 570.8 pts || ui-events | 4 suites / 704 active / 28 ignored / 536.0 pts | 3 suites / 655 active / 5 ignored / 501.7 pts | 3 suites / 655 active / 5 ignored / 501.7 pts || vision-capture | 5 suites / 531 active / 32 ignored / 418.7 pts | 5 suites / 535 active / 32 ignored / 424.2 pts | 4 suites / 526 active / 31 ignored / 415.2 pts |@@ -133,7 +133,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| db-runtime-reliability | screenpipe-db | windows, macos, linux | database, performance | performance-liveness | high | partial | mixed | 13 | 30 | 6 | SQLite hard-fault classification, failpoint VFS injection, fresh-identity recovery verification with integrity/FK/write canaries, query cancellation, close-severs-connections regressions, multi-pool WAL parity, runtime version pinning, and WAL chaos plus memory-pressure probes, plus read-only quarantine self-heal verification for transient IOERR faults. || db-search-indexing | screenpipe-db | windows, macos, linux | db-search, ocr, accessibility, performance | local-api-search, capture-ocr-pipeline, accessibility-ui-events, performance-liveness | high | strong | mixed | 13 | 105 | 4 | FTS, tokenizer, OCR snapshot search, query planning, ordering, accessibility search, and contention coverage. || db-timeline-frames | screenpipe-db | windows, macos, linux | database, timeline, storage, performance | timeline-streaming, performance-liveness | high | strong | mixed | 19 | 178 | 3 | Frame/audio joins, timeline query shape, suggestions frames, write queue, DB primitives (src/db.rs split into src/db/ modules), feedback record upserts, media eviction anti-join regressions, SAF output registry, semantic storage, and timeline performance. |-| engine-api-routes | screenpipe-engine | windows, macos, linux | local-api, timeline, meeting, transcription | local-api-search, timeline-streaming, meeting-live-notes, audio-record-transcribe | high | partial | mixed | 34 | 346 | 4 | Route/unit coverage for search, health, streaming, meetings, time/timezone, and transcription. Legacy endpoint/websocket tests require local data and remain ignored. |+| engine-api-routes | screenpipe-engine | windows, macos, linux | local-api, timeline, meeting, transcription | local-api-search, timeline-streaming, meeting-live-notes, audio-record-transcribe | high | partial | mixed | 34 | 347 | 4 | Route/unit coverage for search, health, streaming, meetings, time/timezone, and transcription. Legacy endpoint/websocket tests require local data and remain ignored. || engine-capture-timeline | screenpipe-engine | windows, macos, linux | vision-capture, timeline, storage, performance | capture-ocr-pipeline, timeline-streaming, performance-liveness | high | partial | mixed | 25 | 289 | 26 | Covers capture trigger logic, frame/audio linking, hot cache, timeline refresh regressions, fragmented MP4 extraction, and HD-mode control. Several real-data tests are intentionally ignored by default. || engine-config-lifecycle | screenpipe-engine | windows, macos, linux | configuration, engine-lifecycle, performance | settings-to-engine-config, engine-health-lifecycle, performance-liveness | high | strong | mixed | 11 | 111 | 1 | Fast logic coverage for the config bridge, tray health debounce, sleep/power policies, and queue backpressure. || engine-db-recovery-cli | screenpipe-engine | windows, macos, linux | database, engine-lifecycle | engine-health-lifecycle, performance-liveness | high | strong | unit | 1 | 8 | 0 | Exact DB/WAL/SHM working-copy preservation, rollback on archive failure, and restart repair for crashes during the multi-file generation swap. |@@ -403,7 +403,7 @@ bun run coverage:core -- --llvm-cov-summary ../../docs/coverage/core-llvm-cov-su| engine-api-routes | screenpipe-engine | src/routes/frames.rs | source | 7 | 1 | 8 || engine-api-routes | screenpipe-engine | src/routes/health.rs | source | 44 | 0 | 44 || engine-api-routes | screenpipe-engine | src/routes/live_views.rs | source | 1 | 0 | 1 |-| engine-api-routes | screenpipe-engine | src/routes/meeting_summary_status.rs | source | 9 | 0 | 9 |+| engine-api-routes | screenpipe-engine | src/routes/meeting_summary_status.rs | source | 10 | 0 | 10 || engine-api-routes | screenpipe-engine | src/routes/meetings.rs | source | 6 | 0 | 6 || engine-api-routes | screenpipe-engine | src/routes/memories.rs | source | 5 | 0 | 5 || engine-api-routes | screenpipe-engine | src/routes/pipe_store.rs | source | 1 | 0 | 1 |