{"record":{"id":"3c16f46d51d654e4","repo":"Significant-Gravitas/AutoGPT","slug":"agent-username-agent-name-not-found","errorCode":null,"errorMessage":"Agent {username}/{agent_name} not found","messagePattern":"Agent (.+?)/(.+?) not found","errorType":"exception","errorClass":"NotFoundError","httpStatus":404,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/store/db.py","lineNumber":314,"sourceCode":"    except Exception as e:\n        # Fail silently here so that logging search terms doesn't break the app\n        logger.error(f\"Error logging search term: {e}\")\n\n\nasync def get_store_agent_details(\n    username: str, agent_name: str, include_changelog: bool = False\n) -> store_model.StoreAgentDetails:\n    \"\"\"Get PUBLIC store agent details from the StoreAgent view\"\"\"\n    logger.debug(f\"Getting store agent details for {username}/{agent_name}\")\n\n    try:\n        agent = await prisma.models.StoreAgent.prisma().find_first(\n            where={\"creator_username\": username, \"slug\": agent_name}\n        )\n\n        if not agent:\n            logger.warning(f\"Agent not found: {username}/{agent_name}\")\n            raise NotFoundError(f\"Agent {username}/{agent_name} not found\")\n\n        # Fetch changelog data if requested\n        changelog_data = None\n        if include_changelog:\n            changelog_versions = (\n                await prisma.models.StoreListingVersion.prisma().find_many(\n                    where={\n                        \"storeListingId\": agent.listing_id,\n                        \"submissionStatus\": prisma.enums.SubmissionStatus.APPROVED,\n                    },\n                    order=[{\"version\": \"desc\"}],\n                )\n            )\n            changelog_data = [\n                store_model.ChangelogEntry(\n                    version=str(version.version),\n                    changes_summary=version.changesSummary or \"No changes recorded\",\n                    date=version.createdAt,","sourceCodeStart":296,"sourceCodeEnd":332,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/store/db.py#L296-L332","documentation":"NotFoundError raised by get_store_agent_details when no row in the StoreAgent view matches the creator username + slug pair. The StoreAgent view only contains APPROVED public listings, so absence can mean the agent doesn't exist, was renamed, was unlisted, or is still pending review.","triggerScenarios":"GET public store agent details for {username}/{agent_name} where the slug is misspelled, the listing was removed/soft-deleted, the creator changed their username, or the submission is not yet APPROVED (pending/rejected versions are invisible to this query).","commonSituations":"Stale links/Bookmarks to agents that were unpublished; frontend routing by slug after a rename; creators previewing their own pending submission via the public endpoint instead of the admin/preview route; scrapers hitting old URLs.","solutions":["Verify the exact current username and slug on the store page (slugs are case-sensitive).","If the submission is pending, use the admin/preview endpoint (get_store_agent_details_as_admin path) rather than the public route.","If the listing was intentionally removed, retire the links pointing at it (redirects or 410 handling).","Search the store by name to find the listing's new slug after a rename."],"exampleFix":"# before\nawait get_store_agent_details(\"old-username\", \"my-agent\")\n# after — resolve current creator/slug first\nlisting = await search_store_agents(\"my agent\");\nawait get_store_agent_details(listing.creator_username, listing.slug)","handlingStrategy":"type-guard","validationCode":"// Resolve listing by search first when details matter\nconst hit = await searchStoreAgents(`${username}/${agent_name}`);\nif (!hit.items.length) throw new NotFoundError('no such agent');","typeGuard":"// Server-side shape to distinguish not-found from DB failure\nfunction isNotFound(e: unknown): e is NotFoundError {\n  return e instanceof Error && e.message.startsWith('Agent ') && e.message.endsWith(' not found');\n}","tryCatchPattern":"try { return await getStoreAgentDetails(u, slug); }\ncatch (e) {\n  if (e instanceof NotFoundError) return null; // render 'not available' page\n  throw e; // DatabaseError needs attention\n}","preventionTips":["Treat 404 as an expected state: render an 'agent unavailable' page, not an error.","Use current creator_username + slug from the store search, not cached URLs.","For pending submissions use the preview/admin route, never the public one."],"tags":["store","not-found","http-404","marketplace"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}