{"record":{"id":"eb72255919352957","repo":"Significant-Gravitas/AutoGPT","slug":"invalid-pagination-input","errorCode":null,"errorMessage":"Invalid pagination input","messagePattern":"Invalid pagination input","errorType":"validation","errorClass":"InvalidInputError","httpStatus":400,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/library/db.py","lineNumber":155,"sourceCode":"            listing itself — e.g. ``has_external_trigger`` / ``trigger_setup_info``,\n            which are False/None without nodes (used by the copilot to recognise\n            webhook-trigger agents without re-reading the full graph).\n\n    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\": [","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/library/db.py#L137-L173","documentation":"Error \"Invalid pagination input\" thrown in Significant-Gravitas/AutoGPT.","triggerScenarios":"Thrown at autogpt_platform/backend/backend/api/features/library/db.py:155 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid page number (>=1) and page size within allowed limits.","Check the client request parameters for negative or non-numeric pagination values."],"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"}