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(onboarding): a deliberate skip is not abandonment
Louis Beaumontf52f00904fbc
diff --git a/apps/screenpipe-app-tauri/components/onboarding/engine-startup.test.tsx b/apps/screenpipe-app-tauri/components/onboarding/engine-startup.test.tsxindex bf48fcd57..38999123c 100644--- a/apps/screenpipe-app-tauri/components/onboarding/engine-startup.test.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/engine-startup.test.tsx@@ -373,6 +373,50 @@ describe("onboarding engine startup", () => {);});+ // Observed in production on 2.6.29: a macOS user skipped Screen Recording,+ // the engine correctly refused with kind=permission, they clicked skip on the+ // stuck screen, reached the plan step, loaded the card checkout and landed on+ // Home. Healthy. The beacon still called it abandonment, and left alone every+ // permission-skipper would pollute the one number that tells us whether users+ // are stranded.+ it("does not call a deliberate skip abandonment", async () => {+ mocks.localFetch.mockRejectedValue(new Error("Load failed"));+ mocks.spawnScreenpipe.mockResolvedValue({+ status: "error",+ error: "Screen recording permission required. Please grant permission.",+ });++ const { unmount, getByTestId } = render(+ <EngineStartup handleNextSlide={mocks.handleNextSlide} />,+ );++ // The spawn error flips straight to the stuck screen, which owns the skip.+ await waitFor(() =>+ expect(mocks.capture).toHaveBeenCalledWith(+ "onboarding_engine_spawn_failed",+ expect.objectContaining({ error_kind: "permission" }),+ ),+ );++ await act(async () => {+ getByTestId("onboarding-startup-skip").click();+ });+ await waitFor(() =>+ expect(mocks.capture).toHaveBeenCalledWith(+ "onboarding_startup_skipped",+ expect.any(Object),+ ),+ );++ unmount();++ expect(mocks.capture).not.toHaveBeenCalledWith(+ "onboarding_engine_abandoned",+ expect.anything(),+ expect.anything(),+ );+ });+it("stays quiet on unmount once the engine is up", async () => {mocks.localFetch.mockImplementation(async () =>new Response(diff --git a/apps/screenpipe-app-tauri/components/onboarding/engine-startup.tsx b/apps/screenpipe-app-tauri/components/onboarding/engine-startup.tsxindex 9715b336a..94018915b 100644--- a/apps/screenpipe-app-tauri/components/onboarding/engine-startup.tsx+++ b/apps/screenpipe-app-tauri/components/onboarding/engine-startup.tsx@@ -176,6 +176,11 @@ export default function EngineStartup({ handleNextSlide }: EngineStartupProps) {// Stamped on the unreachable report; triage otherwise has to join another// event to learn which build produced it.const appVersionRef = useRef<string | null>(null);+ // Set when the user chooses to move on from the stuck screen. A permission+ // skip is a healthy outcome — the engine names the real reason, the user+ // continues, reaches the plan step and lands on Home — and counting it as+ // abandonment would bury the signal the beacon exists to carry.+ const leftDeliberatelyRef = useRef(false);// Read by the unmount beacon so it can tell "left while still waiting" apart// from "left after the engine came up".const stateRef = useRef<StartupState>("starting");@@ -215,7 +220,7 @@ export default function EngineStartup({ handleNextSlide }: EngineStartupProps) {// the hole: leaving without reaching "running" is itself the finding.useEffect(() => () => {- if (stateRef.current === "running") return;+ if (stateRef.current === "running" || leftDeliberatelyRef.current) return;posthog.capture("onboarding_engine_abandoned",{@@ -544,6 +549,9 @@ export default function EngineStartup({ handleNextSlide }: EngineStartupProps) {}, [state, bootPhase?.phase, stuckCheckTick]);const handleSkip = async () => {+ // Leaving by choice is not abandonment. `handleContinueWithoutRecording`+ // routes through here too, so this covers both explicit exits.+ leftDeliberatelyRef.current = true;posthog.capture("onboarding_startup_skipped", {serverStarted,audioReady,@@ -901,6 +909,7 @@ export default function EngineStartup({ handleNextSlide }: EngineStartupProps) {)}<buttononClick={handleSkip}+ data-testid="onboarding-startup-skip"className="font-mono text-xs text-muted-foreground hover:text-foreground transition-colors underline underline-offset-4">continue without recording →