{"record":{"id":"a47bff428cb26898","repo":"Significant-Gravitas/AutoGPT","slug":"search-term-is-too-long","errorCode":null,"errorMessage":"Search term is too long","messagePattern":"Search term is too long","errorType":"validation","errorClass":"InvalidInputError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/db.py","lineNumber":159,"sourceCode":"    Returns:\n        A LibraryAgentResponse containing the list of agents and pagination details.\n\n    Raises:\n        DatabaseError: If there is an issue fetching from Prisma.\n    \"\"\"\n    logger.debug(\n        f\"Fetching library agents for user_id={user_id}, \"\n        f\"search_term={repr(search_term)}, \"\n        f\"sort_by={sort_by}, page={page}, page_size={page_size}\"\n    )\n\n    if page < 1 or page_size < 1:\n        logger.warning(f\"Invalid pagination: page={page}, page_size={page_size}\")\n        raise InvalidInputError(\"Invalid pagination input\")\n\n    if search_term and len(search_term.strip()) > 100:\n        logger.warning(f\"Search term too long: {repr(search_term)}\")\n        raise InvalidInputError(\"Search term is too long\")\n\n    where_clause: prisma.types.LibraryAgentWhereInput = {\n        \"userId\": user_id,\n        \"isDeleted\": False,\n        \"isArchived\": False,\n    }\n    # Library entries are personal bookmarks (per-user favorites/folders),\n    # so org context scopes rather than shares: the caller's own rows in\n    # the active org, plus untagged pre-backfill rows. Nested in AND so it\n    # can't collide with the search OR-clause below.\n    if organization_id is not None:\n        where_clause[\"AND\"] = [\n            {\n                \"OR\": [\n                    {\"organizationId\": organization_id},\n                    {\"organizationId\": None},\n                ]\n            }","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L141-L177","documentation":"Error \"Search term is too long\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:159 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Shorten the search term to within the maximum allowed length.","Split the search into multiple narrower queries."],"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"}