{"record":{"id":"c35862c8f77dc713","repo":"Significant-Gravitas/AutoGPT","slug":"library-agent-library-agent-id-not-found","errorCode":null,"errorMessage":"Library agent {library_agent_id} not found","messagePattern":"Library agent (.+?) not found","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/db.py","lineNumber":1009,"sourceCode":"        # Get the current agent to find its graph_id\n        agent = await get_library_agent(id=library_agent_id, user_id=user_id)\n        # Update to the specified version using existing function\n        return await update_agent_version_in_library(\n            user_id=user_id,\n            agent_graph_id=agent.graph_id,\n            agent_graph_version=graph_version,\n        )\n\n    # Otherwise, just update the simple fields\n    if not update_fields:\n        raise ValueError(\"No values were passed to update\")\n\n    n_updated = await prisma.models.LibraryAgent.prisma().update_many(\n        where={\"id\": library_agent_id, \"userId\": user_id},\n        data=update_fields,\n    )\n    if n_updated < 1:\n        raise NotFoundError(f\"Library agent {library_agent_id} not found\")\n\n    return await get_library_agent(\n        id=library_agent_id,\n        user_id=user_id,\n    )\n\n\nasync def delete_library_agent(\n    library_agent_id: str, user_id: str, soft_delete: bool = True\n) -> None:\n    # First get the agent to find the graph_id for cleanup\n    library_agent = await prisma.models.LibraryAgent.prisma().find_unique(\n        where={\"id\": library_agent_id}, include={\"AgentGraph\": True}\n    )\n\n    if not library_agent or library_agent.userId != user_id:\n        raise NotFoundError(f\"Library agent #{library_agent_id} not found\")\n","sourceCodeStart":991,"sourceCodeEnd":1027,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L991-L1027","documentation":"Error \"Library agent {library_agent_id} not found\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:1009 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the library agent ID is correct and belongs to your account.","Refresh the library; the agent may have been deleted."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}