{"record":{"id":"7a09abdd6c2d18e2","repo":"cjpais/Handy","slug":"cohere-transcription-failed","errorCode":null,"errorMessage":"Cohere transcription failed: {}","messagePattern":"Cohere transcription failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-tauri/src/managers/transcription.rs","lineNumber":1430,"sourceCode":"                            .transcribe(&audio, &options)\n                            .map(|r| r.text)\n                            .map_err(|e| anyhow::anyhow!(\"Canary transcription failed: {}\", e))\n                    }\n                    LoadedEngine::Cohere(cohere_engine) => {\n                        let lang = if validated_language == \"auto\" {\n                            None\n                        } else {\n                            Some(normalize_cjk_language(&validated_language).to_string())\n                        };\n                        applied_language_hint = lang.clone();\n                        let options = TranscribeOptions {\n                            language: lang,\n                            ..Default::default()\n                        };\n                        cohere_engine\n                            .transcribe(&audio, &options)\n                            .map(|r| r.text)\n                            .map_err(|e| anyhow::anyhow!(\"Cohere transcription failed: {}\", e))\n                    }\n                }\n            }));\n\n            let text = match transcribe_result {\n                Ok(inner_result) => {\n                    // Success or normal error: return the engine unless a model\n                    // switch/unload invalidated it while it was in use.\n                    self.return_engine(engine, &active_model);\n                    inner_result?\n                }\n                Err(panic_payload) => {\n                    // Engine panicked — do NOT put it back (it's in an unknown state).\n                    // The engine is dropped here, effectively unloading it.\n                    let panic_msg = panic_payload_message(panic_payload.as_ref());\n                    error!(\n                        \"Transcription engine panicked: {}. Model has been unloaded.\",\n                        panic_msg","sourceCodeStart":1412,"sourceCodeEnd":1448,"githubUrl":"https://github.com/cjpais/Handy/blob/ba10ce1943ef34e93c09494027fc0b9ced2e8a44/src-tauri/src/managers/transcription.rs#L1412-L1448","documentation":"The Cohere branch normalizes the language (normalize_cjk_language) into TranscribeOptions and calls transcribe; this error wraps the ONNX Runtime failure from the Cohere Int8 graph. It is the last engine arm before the match closes and the engine is returned via return_engine.","triggerScenarios":"cohere_engine.transcribe errors: ORT provider failure, invalid input tensor shape from very short audio, or corrupted Int8 model graph.","commonSituations":"Driver/GPU instability; near-empty audio after VAD; model files damaged.","solutions":["Inspect the chained ORT error; switch accelerator to CPU for provider errors","Retry with longer audio","Re-download the Cohere model","Update the app if ORT/model compatibility changed"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"match manager.transcribe(audio.clone()) {\n    Err(e) if e.to_string().contains(\"Cohere transcription failed\") => manager.transcribe(audio),\n    other => other,\n}","preventionTips":["Use a language the Cohere model supports (or auto) to avoid edge-case graph paths","Keep model files intact; re-download on reproducible failures","Switch accelerator to CPU for triage"],"tags":["rust","onnx","cohere","inference"],"backgroundTag":"model-inference-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"}