{"record":{"id":"c17b744c1638d3c0","repo":"Significant-Gravitas/AutoGPT","slug":"library-agent-id-not-found","errorCode":null,"errorMessage":"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":395,"sourceCode":"\n    Returns:\n        The requested LibraryAgent.\n\n    Raises:\n        NotFoundError: If the specified agent does not exist.\n        DatabaseError: If there's an error during retrieval.\n    \"\"\"\n    library_agent = await prisma.models.LibraryAgent.prisma().find_first(\n        where={\n            \"id\": id,\n            \"userId\": user_id,\n            \"isDeleted\": False,\n        },\n        include=library_agent_include(user_id),\n    )\n\n    if not library_agent:\n        raise NotFoundError(f\"Library agent #{id} not found\")\n\n    # Fetch marketplace listing if the agent has been published\n    store_listing = None\n    profile = None\n    if library_agent.AgentGraph:\n        store_listing = await prisma.models.StoreListing.prisma().find_first(\n            where={\n                \"agentGraphId\": library_agent.AgentGraph.id,\n                \"isDeleted\": False,\n                \"hasApprovedVersion\": True,\n            },\n            include={\n                \"ActiveVersion\": True,\n            },\n        )\n        if store_listing and store_listing.ActiveVersion and store_listing.owningUserId:\n            # Fetch Profile separately since User doesn't have a direct Profile relation\n            profile = await prisma.models.Profile.prisma().find_first(","sourceCodeStart":377,"sourceCodeEnd":413,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L377-L413","documentation":"Error \"Library agent #{id} not found\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:395 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 list; the agent may have been removed."],"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-15T17:31:12.345Z"}