{"record":{"id":"f003d63ffcae4dff","repo":"odysseus-dev/odysseus","slug":"skill-not-found","errorCode":null,"errorMessage":"Skill not found","messagePattern":"Skill not found","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"routes/skills_routes.py","lineNumber":1102,"sourceCode":"    job = _skill_audit_jobs.get(key, {})\n    return {\"status\": \"done\", \"total\": len(names), \"results\": job.get(\"results\", [])}\n\n\ndef setup_skills_routes(skills_manager: SkillsManager) -> APIRouter:\n    router = APIRouter(prefix=\"/api/skills\", tags=[\"skills\"])\n\n    def _owner(request: Request) -> Optional[str]:\n        return get_current_user(request)\n\n    def _verify_owner(skill: dict, user: Optional[str]):\n        if user is None:\n            return\n        # SECURITY: strict check — previously `sk_owner and sk_owner != user`\n        # let any user mutate/read a skill that happened to have no owner\n        # field (legacy or un-stamped writes), since the truthiness guard\n        # short-circuited the comparison. Treat missing owner as not-owned.\n        if skill.get(\"owner\") != user:\n            raise HTTPException(404, \"Skill not found\")\n\n    def _fire_skill_added(user: Optional[str]):\n        try:\n            from src.event_bus import fire_event\n            fire_event(\"skill_added\", user)\n        except Exception:\n            logger.debug(\"skill_added event dispatch failed\", exc_info=True)\n\n    @router.get(\"\")\n    async def list_skills(request: Request):\n        user = _owner(request)\n        skills = skills_manager.load(owner=user)\n        return {\"skills\": skills, \"count\": len(skills)}\n\n    @router.get(\"/index\")\n    async def get_index(request: Request):\n        \"\"\"The lightweight `[{name, description, category}]` list that the\n        agent's system prompt sees. Useful for the UI's \"what does the model","sourceCodeStart":1084,"sourceCodeEnd":1120,"githubUrl":"https://github.com/odysseus-dev/odysseus/blob/f9235ebbf13f693a6fd29ce70b097f6ec83705bf/routes/skills_routes.py#L1084-L1120","documentation":"Error \"Skill not found\" thrown in odysseus-dev/odysseus.","triggerScenarios":"Triggered when the corresponding server-side validation or runtime check at the recorded location rejects the request or operation and returns this error message to the caller.","commonSituations":"See trigger scenarios.","solutions":["Refresh the skills list; the skill may have been removed.","Verify the skill name or id is correct."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f9235ebbf13f693a6fd29ce70b097f6ec83705bf","analyzedAt":"2026-08-14T21:47:48.359Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}