{"record":{"id":"db5603a4218cbb17","repo":"iflytek/astron-agent","slug":"sparkdesk-rag-does-not-support-chunks-save-operation","errorCode":null,"errorMessage":"SparkDesk-RAG does not support chunks_save operation.","messagePattern":"SparkDesk-RAG does not support chunks_save operation\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"core/knowledge/service/impl/sparkdesk_strategy.py","lineNumber":92,"sourceCode":"        self, docId: str, group: str, uid: str, chunks: List[Any], **kwargs: Any\n    ) -> Any:\n        \"\"\"\n        Save chunks to knowledge base\n\n        Args:\n            doc_id: Document ID\n            group: Group name\n            uid: User ID\n            chunks: Chunk list\n            **kwargs: Other parameters\n\n        Returns:\n            Save result\n\n        Raises:\n            NotImplementedError: SparkDesk-RAG does not support save operation\n        \"\"\"\n        raise NotImplementedError(\n            \"SparkDesk-RAG does not support chunks_save operation.\"\n        )\n\n    async def chunks_update(\n        self,\n        docId: str,\n        group: str,\n        uid: str,\n        chunks: List[Dict[str, Any]],\n        **kwargs: Any\n    ) -> Any:\n        \"\"\"\n        Update chunks\n\n        Args:\n            doc_id: Document ID\n            group: Group name\n            uid: User ID","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/knowledge/service/impl/sparkdesk_strategy.py#L74-L110","documentation":"SparkDeskRagStrategy.chunks_save() is an intentional stub. The SparkDesk-RAG service has no API for saving pre-split chunks, so the adapter raises NotImplementedError. It only exists to fulfill the RagStrategy abstract interface.","triggerScenarios":"Calling chunks_save(docId, group, uid, chunks) on a SparkDesk-RAG strategy instance, e.g. attempting to persist manually split chunks to the SparkDesk knowledge base.","commonSituations":"Pipelines that split documents client-side then upload chunks, reused unchanged after switching the RAG backend to SparkDesk via configuration.","solutions":["Use the strategy's document-upload flow instead of saving chunks manually","Guard the call by backend type and skip chunk persistence for SparkDesk","Implement chunks_save against a SparkDesk endpoint if one becomes available"],"exampleFix":"// before\nawait strategy.chunks_save(docId, group, uid, chunks)\n// after\nif strategy.supports_chunks_save:\n    await strategy.chunks_save(docId, group, uid, chunks)","handlingStrategy":"validation","validationCode":"def supports_chunks_save(strategy) -> bool:\n    return not isinstance(strategy, SparkDeskRagStrategy)","typeGuard":"def is_sparkdesk(strategy) -> bool:\n    return isinstance(strategy, SparkDeskRagStrategy)","tryCatchPattern":"try:\n    await strategy.chunks_save(docId, group, uid, chunks)\nexcept NotImplementedError:\n    logger.warning(\"chunks_save unsupported by backend; skipping\")","preventionTips":["Avoid client-side chunk persistence workflows on SparkDesk backends","Use the backend's document upload path instead of manual chunk saving","Add capability flags to the strategy interface"],"tags":["python","rag","not-implemented","sparkdesk"],"backgroundTag":"unsupported-operation","analyzedSha":"5e758547a83371a5a4b29dadf4ac03e8dd527635","analyzedAt":"2026-09-12T08:03:51.356Z","contentChangedAt":"2026-09-12T08:03:51.356Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}