{"record":{"id":"ebf70b125968f6cb","repo":"zylon-ai/private-gpt","slug":"unsupported-content-block-type-type-block","errorCode":null,"errorMessage":"Unsupported content block type: {type(block)}","messagePattern":"Unsupported content block type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"private_gpt/chat/input_models.py","lineNumber":480,"sourceCode":"                                MessageInput(\n                                    role=msg.role,\n                                    content=current_blocks,\n                                )\n                            )\n                            current_blocks = []\n\n                        result.append(\n                            MessageInput(\n                                role=\"assistant\",\n                                content=[block],\n                            )\n                        )\n                    elif isinstance(block, ContentBlockType):\n                        current_blocks.append(block)\n                    elif isinstance(block, str):\n                        current_blocks.append(TextBlock(text=block))\n                    else:\n                        raise ValueError(\n                            f\"Unsupported content block type: {type(block)}\"\n                        )\n\n                if current_blocks:\n                    result.append(\n                        MessageInput(\n                            role=msg.role,\n                            content=current_blocks,\n                        )\n                    )\n            else:\n                result.append(msg)\n\n        return result\n\n    @classmethod\n    def _validate_message_order(cls, messages: list[ChatMessage]) -> None:\n        \"\"\"Validates the order of the messages.\"\"\"","sourceCodeStart":462,"sourceCodeEnd":498,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/chat/input_models.py#L462-L498","documentation":"Raised by the GET /skills/{skill_id} route when SkillService.get_skill() returns None for the given skill_id and collection. Skills are namespaced per collection; querying an id that does not exist in that specific collection boundary yields this 404.","triggerScenarios":"GET /skills/{skill_id}?collection=X where the skill lives in collection Y or was deleted; a freshly created skill read before eventual consistency; typo or URL-encoded id mismatch.","commonSituations":"Client switches collection context but keeps the previously selected skill id; skill deleted in another session; environment mismatch (dev id used against prod collection); pagination cursor pointing at removed entries.","solutions":["Verify the skill id exists in the exact collection via the list-skills endpoint for that collection.","Re-fetch the skill list after collection changes and clear stale selections.","Handle 404 by removing the skill from local cache and refreshing."],"exampleFix":"// before\nconst skill = await skillsApi.get(selectedId, currentCollection);\n\n// after\nconst skill = await skillsApi.get(selectedId, currentCollection).catch((e) => {\n  if (e.status === 404) { cache.remove(selectedId); return null; }\n  throw e;\n});","handlingStrategy":"try-catch","validationCode":"const list = await skillsApi.list(collection);\nif (!list.data.some((s) => s.id === skillId)) throw new NotFoundError(skillId);","typeGuard":null,"tryCatchPattern":"try { return await skillsApi.get(skillId, collection); }\ncatch (e) {\n  if (e.status === 404) { cache.delete(skillId); return null; }\n  throw e;\n}","preventionTips":["Invalidate cached skill ids when the active collection changes","Refresh skill lists after delete operations in other sessions","Always send the collection that the skill was created in"],"tags":["fastapi","http-404","skills","collections","not-found"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}