{"record":{"id":"137853499e72d471","repo":"bytedance/deer-flow","slug":"failed-to-delete-custom-skill-str-e","errorCode":null,"errorMessage":"Failed to delete custom skill: {str(e)}","messagePattern":"Failed to delete custom skill: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":500,"severity":"error","filePath":"backend/app/gateway/routers/skills.py","lineNumber":331,"sourceCode":"            history_meta={\n                \"action\": \"human_delete\",\n                \"author\": \"human\",\n                \"thread_id\": None,\n                \"file_path\": SKILL_MD_FILE,\n                \"prev_content\": None,\n                \"new_content\": None,\n                \"scanner\": {\"decision\": \"allow\", \"reason\": \"Deletion requested.\"},\n            },\n        )\n        await refresh_user_skills_system_prompt_cache_async(get_effective_user_id())\n        return {\"success\": True}\n    except FileNotFoundError as e:\n        raise HTTPException(status_code=404, detail=str(e))\n    except ValueError as e:\n        raise HTTPException(status_code=400, detail=str(e))\n    except Exception as e:\n        logger.error(\"Failed to delete custom skill %s: %s\", skill_name, e, exc_info=True)\n        raise HTTPException(status_code=500, detail=f\"Failed to delete custom skill: {str(e)}\")\n\n\n@router.get(\"/skills/custom/{skill_name}/history\", response_model=CustomSkillHistoryResponse, summary=\"Get Custom Skill History\")\nasync def get_custom_skill_history(skill_name: str, request: Request, config: AppConfig = Depends(get_config)) -> CustomSkillHistoryResponse:\n    await require_admin_user(request, detail=_ADMIN_REQUIRED_DETAIL)\n    try:\n        skill_name = skill_name.replace(\"\\r\\n\", \"\").replace(\"\\n\", \"\")\n\n        def _read_history() -> list[dict] | None:\n            # Worker thread: storage construction, the existence probes, and the\n            # history-file read are blocking filesystem IO that must stay off the\n            # event loop. None signals 404 to the caller.\n            storage = _get_user_skill_storage(config)\n            if not storage.custom_skill_exists(skill_name) and not storage.get_skill_history_file(skill_name).exists():\n                return None\n            return storage.read_history(skill_name)\n\n        history = await asyncio.to_thread(_read_history)","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/skills.py#L313-L349","documentation":"Error \"Failed to delete custom skill: {str(e)}\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/skills.py:331 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Gateway logs for the underlying delete error.","Verify the custom skill exists and no process holds locks on its directory, then retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}