{"record":{"id":"e8303347cc7321bc","repo":"bytedance/deer-flow","slug":"history-index-is-out-of-range","errorCode":null,"errorMessage":"history_index is out of range","messagePattern":"history_index is out of range","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"backend/app/gateway/routers/skills.py","lineNumber":399,"sourceCode":"            \"author\": \"human\",\n            \"thread_id\": None,\n            \"file_path\": SKILL_MD_FILE,\n            \"prev_content\": current_content,\n            \"new_content\": target_content,\n            \"rollback_from_ts\": record.get(\"ts\"),\n            \"scanner\": {\"decision\": scan.decision, \"reason\": scan.reason, \"static_findings\": static_findings},\n        }\n        if scan.decision == \"block\":\n            await asyncio.to_thread(storage.append_history, skill_name, history_entry)\n            raise HTTPException(status_code=400, detail=f\"Rollback blocked by security scanner: {scan.reason}\")\n        await asyncio.to_thread(storage.write_custom_skill, skill_name, SKILL_MD_FILE, target_content)\n        await asyncio.to_thread(storage.append_history, skill_name, history_entry)\n        await refresh_user_skills_system_prompt_cache_async(get_effective_user_id())\n        return await _read_custom_skill_response(skill_name, config)\n    except HTTPException:\n        raise\n    except IndexError:\n        raise HTTPException(status_code=400, detail=\"history_index is out of range\")\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 roll back custom skill %s: %s\", skill_name, e, exc_info=True)\n        raise HTTPException(status_code=500, detail=f\"Failed to roll back custom skill: {str(e)}\")\n\n\n@router.get(\n    \"/skills/{skill_name}\",\n    response_model=SkillResponse,\n    summary=\"Get Skill Details\",\n    description=\"Retrieve detailed information about a specific skill by its name.\",\n)\nasync def get_skill(skill_name: str, config: AppConfig = Depends(get_config)) -> SkillResponse:\n    try:\n        skill_name = skill_name.replace(\"\\r\\n\", \"\").replace(\"\\n\", \"\")","sourceCodeStart":381,"sourceCodeEnd":417,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/app/gateway/routers/skills.py#L381-L417","documentation":"Error \"history_index is out of range\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/app/gateway/routers/skills.py:399 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fetch the skill history list and use a history_index within its bounds (0-based).","Refresh the UI; the history may have changed since the index was captured."],"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-15T22:17:37.221Z"}