{"record":{"id":"62a98eea0e7cf10e","repo":"farion1231/cc-switch","slug":"imported-skills-skipped-minimax-code-entries","errorCode":null,"errorMessage":"Imported {} Skills; skipped MiniMax Code entries: {}","messagePattern":"Imported (.+?) Skills; skipped MiniMax Code entries: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"warning","filePath":"src-tauri/src/services/skill.rs","lineNumber":2225,"sourceCode":"                readme_url,\n                apps,\n                installed_at: chrono::Utc::now().timestamp(),\n                content_hash,\n                updated_at: 0,\n            };\n\n            // 保存到数据库\n            db.save_skill(&skill)?;\n\n            imported.push(skill);\n        }\n\n        log::info!(\"成功导入 {} 个 Skills\", imported.len());\n\n        if skipped_mcode.is_empty() {\n            Ok(imported)\n        } else {\n            Err(anyhow!(\n                \"Imported {} Skills; skipped MiniMax Code entries: {}\",\n                imported.len(),\n                skipped_mcode.join(\"; \")\n            ))\n        }\n    }\n\n    // ========== 文件同步方法 ==========\n\n    /// 创建符号链接（跨平台）\n    ///\n    /// - Unix: 使用 std::os::unix::fs::symlink\n    /// - Windows: 使用 std::os::windows::fs::symlink_dir\n    #[cfg(unix)]\n    fn create_symlink(src: &Path, dest: &Path) -> Result<()> {\n        std::os::unix::fs::symlink(src, dest)\n            .with_context(|| format!(\"创建符号链接失败: {} -> {}\", src.display(), dest.display()))\n    }","sourceCodeStart":2207,"sourceCodeEnd":2243,"githubUrl":"https://github.com/farion1231/cc-switch/blob/06082e189d65e6d6dbadc35dacdac1ce6c79d89a/src-tauri/src/services/skill.rs#L2207-L2243","documentation":"During skill import, entries belonging to MiniMax Code (MCode) that cannot be imported are collected into skipped_mcode. If any were skipped, the function still reports the successfully imported count but returns an Err listing the skipped entries, so callers know the import was partial and which entries need attention. It is a 'partial success reported as error' pattern.","triggerScenarios":"Calling the skill import API (e.g. importing from a marketplace/directory batch) where at least one MiniMax Code entry fails validation/deployment and gets pushed to skipped_mcode, while other entries import fine. The Err fires only when skipped_mcode is non-empty.","commonSituations":"Batch import containing MCode-specific entries in an environment or app-type where they are not supported; entries with invalid structure/hash that fail deployment checks; mixed-source import folders where some entries belong to another app type.","solutions":["Read the skipped list after the semicolon in the message; fix or remove those specific entries and re-import only them.","Check that the import source entries are valid MCode skills (correct manifest/content hash) and supported by the current app type.","If the skipped entries are expected to be unsupported, treat the import as complete for the imported set and log the skipped names instead of retrying.","Separate MCode entries from other app-type entries before import to avoid partial-batch failures."],"exampleFix":"// before: treating the whole import as failed\nmatch import_skills(entries) {\n    Err(e) => return e,\n    Ok(imported) => return Ok(imported),\n}\n// after: handle partial import\nmatch import_skills(entries) {\n    Err(e) if e.to_string().starts_with(\"Imported \") => {\n        log::warn!(\"partial import: {e}\");\n        Ok(())\n    }\n    other => other,\n}","handlingStrategy":"try-catch","validationCode":"fn prefilter_mcode(entries: &[Entry], supported: &[AppType]) -> Vec<&Entry> {\n    entries.iter().filter(|e| !supported.contains(&e.app_type)).collect()\n}","typeGuard":null,"tryCatchPattern":"match import_skills(entries) {\n    Err(e) if e.to_string().starts_with(\"Imported \") => {\n        let skipped: Vec<&str> = e.to_string().rsplit(\": \").next().unwrap_or(\"\").split(\"; \").collect();\n        log::warn!(\"partially imported, skipped: {skipped:?}\");\n    }\n    Err(e) => return Err(e),\n    Ok(v) => Ok(v),\n}","preventionTips":["Validate MCode entries (manifest, content hash) before batch import","Filter out unsupported app-type entries ahead of the import call","Always parse the skipped list from the error instead of assuming total failure","Import per app-type so one bad entry doesn't mask the rest"],"tags":["import","partial-failure","skill-sync","batch"],"backgroundTag":"partial-import-skipped-entries","analyzedSha":"06082e189d65e6d6dbadc35dacdac1ce6c79d89a","analyzedAt":"2026-09-19T08:37:02.504Z","contentChangedAt":"2026-09-19T08:37:02.504Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}