{"record":{"id":"0f4c4045bfb36b08","repo":"zylon-ai/private-gpt","slug":"invalid-system-specification-system","errorCode":null,"errorMessage":"Invalid system specification: {system}","messagePattern":"Invalid system specification: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/chat/input_models.py","lineNumber":254,"sourceCode":"                    known_citations=list(\n                        {\n                            *(potential_system.citations.known_citations or []),\n                            *(item.citations.known_citations or []),\n                        }\n                    ),\n                ),\n                extensions=list(\n                    dict.fromkeys(\n                        [*(potential_system.extensions or []), *(item.extensions or [])]\n                    )\n                ),\n                blob_visibility=item.blob_visibility,\n            )\n\n        return potential_system\n\n    # Unknown type\n    raise ValueError(f\"Invalid system specification: {system}\")\n\n\nSystemOrStr = Annotated[System, BeforeValidator(validate_system_config)]\n\n\nclass ToolChoice(BaseModel):\n    \"\"\"Configuration for tool selection behavior during AI interactions.\"\"\"\n\n    type: Literal[\"auto\", \"any\", \"tool\", \"none\"] = Field(\n        default=\"auto\", description=\"Tool selection strategy\"\n    )\n    name: str | None = Field(\n        default=None, description=\"Name of the tool to use if not auto-selecting\"\n    )\n    disable_parallel_tool_use: bool = Field(\n        default=False,\n        description=\"When true, prevents the AI from using multiple tools simultaneously\",\n    )","sourceCodeStart":236,"sourceCodeEnd":272,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/chat/input_models.py#L236-L272","documentation":"Raised by the async deletion endpoint when the configured scheduler raises NotImplementedError from delete_async(). Same class of failure as async ingestion: the active IngestionScheduler has no async backend, so asynchronous document deletion cannot be dispatched and the API returns 501.","triggerScenarios":"POST to /ingest/delete/async while running a scheduler without async support (no Celery); workers/broker not configured despite async routes being mounted.","commonSituations":"Same as async ingest: local dev profile without Celery; deployment where the async scheduler flag was lost during config migration; SDK auto-selecting async API from the OpenAPI spec.","solutions":["Use the synchronous deletion endpoint when running without an async scheduler.","Configure the Celery scheduler (broker, backend, running workers) to enable async deletion.","Check settings for the scheduler mode after upgrades."],"exampleFix":"# before\nPOST /ingest/delete/async   # 501\n\n# after\nPOST /ingest/delete   # synchronous path\n# or configure celery scheduler and retry async","handlingStrategy":"fallback","validationCode":"const asyncDeletionSupported = await probeAsyncCapability(); // false on 501 probe\nif (!asyncDeletionSupported) useSyncDelete = true;","typeGuard":null,"tryCatchPattern":"try { return await api.deleteAsync(body); }\ncatch (e) {\n  if (e.status === 501) return api.deleteSync(body);\n  throw e;\n}","preventionTips":["Detect 501 once and route all deletion to the sync endpoint","Ensure workers are running before enabling async client features","Include scheduler mode in deployment smoke tests"],"tags":["fastapi","http-501","celery","ingestion","deletion"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}