{"record":{"id":"0b637dc1c5627e65","repo":"cjpais/Handy","slug":"failed-to-initialize-transcription-manager","errorCode":null,"errorMessage":"Failed to initialize transcription manager","messagePattern":"Failed to initialize transcription manager","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src-tauri/src/lib.rs","lineNumber":199,"sourceCode":"    }\n\n    false\n}\n\nfn initialize_core_logic(app_handle: &AppHandle) {\n    // Note: Enigo (keyboard/mouse simulation) is NOT initialized here.\n    // The frontend is responsible for calling the `initialize_enigo` command\n    // after onboarding completes. This avoids triggering permission dialogs\n    // on macOS before the user is ready.\n\n    // Initialize the managers. The audio recorder receives the streaming router\n    // explicitly, so always-on microphone startup can wire live-preview frames\n    // even before Tauri state is populated.\n    let model_manager =\n        Arc::new(ModelManager::new(app_handle).expect(\"Failed to initialize model manager\"));\n    let transcription_manager = Arc::new(\n        TranscriptionManager::new(app_handle, model_manager.clone())\n            .expect(\"Failed to initialize transcription manager\"),\n    );\n    let recording_manager = Arc::new(\n        AudioRecordingManager::new(app_handle, transcription_manager.stream_router())\n            .expect(\"Failed to initialize recording manager\"),\n    );\n    let history_manager =\n        Arc::new(HistoryManager::new(app_handle).expect(\"Failed to initialize history manager\"));\n\n    // Initialize the transcribe-cpp native backend (logging + backend module\n    // registration) once, before any whisper model is loaded.\n    managers::transcription::init_transcribe_backend();\n\n    // Apply accelerator preferences before any model loads\n    managers::transcription::apply_accelerator_settings(app_handle);\n\n    // Add managers to Tauri's managed state\n    app_handle.manage(recording_manager.clone());\n    app_handle.manage(model_manager.clone());","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/cjpais/Handy/blob/ba10ce1943ef34e93c09494027fc0b9ced2e8a44/src-tauri/src/lib.rs#L181-L217","documentation":"Startup panic when TranscriptionManager::new returns Err. In the current implementation the constructor only assembles the manager struct and spawns the idle-watcher thread, returning Ok on the shown path — so this expect firing means a modified/future constructor added fallible work, or a fork changed init semantics. The panic occurs after ModelManager is already built.","triggerScenarios":"initialize_core_logic calling TranscriptionManager::new(app_handle, model_manager) and receiving Err — only reachable if the constructor gains fallible steps (store access, thread spawn under thread limits) in your build.","commonSituations":"Practically unseen in stock builds; appears in forks or custom builds where the constructor was extended with fallible initialization, or in environments that exhaust thread creation.","solutions":["Read the panic backtrace to identify which added fallible step returned Err in your build","Check the constructor for newly ?-propagated calls (settings store access, thread spawn) and fix the underlying failure","If thread creation is failing, raise thread limits (ulimit -u) or reduce background threads in the environment"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["When extending a constructor with fallible work, move it into an explicit init() returning Result and handle it instead of growing the expect surface","Prefer startup diagnostics over expect so failures produce a report window, not a silent abort"],"tags":["rust","tauri","startup","constructor","panic"],"backgroundTag":"startup-manager-init-failed","analyzedSha":"ba10ce1943ef34e93c09494027fc0b9ced2e8a44","analyzedAt":"2026-08-17T10:29:55.597Z","contentChangedAt":"2026-08-17T10:29:55.597Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}