{"record":{"id":"85a72c413dbd445e","repo":"iflytek/astron-agent","slug":"sparkdesk-rag-does-not-support-chunks-update-operation","errorCode":null,"errorMessage":"SparkDesk-RAG does not support chunks_update operation.","messagePattern":"SparkDesk-RAG does not support chunks_update operation\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"core/knowledge/service/impl/sparkdesk_strategy.py","lineNumber":120,"sourceCode":"        **kwargs: Any\n    ) -> Any:\n        \"\"\"\n        Update chunks\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            Update result\n\n        Raises:\n            NotImplementedError: SparkDesk-RAG does not support update operation\n        \"\"\"\n        raise NotImplementedError(\n            \"SparkDesk-RAG does not support chunks_update operation.\"\n        )\n\n    async def chunks_delete(\n        self, docId: str, chunkIds: List[str], **kwargs: Any\n    ) -> Any:\n        \"\"\"\n        Delete chunks\n\n        Args:\n            doc_id: Document ID\n            chunk_ids: Chunk ID list\n            **kwargs: Other parameters\n\n        Returns:\n            Delete result\n\n        Raises:","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/iflytek/astron-agent/blob/5e758547a83371a5a4b29dadf4ac03e8dd527635/core/knowledge/service/impl/sparkdesk_strategy.py#L102-L138","documentation":"SparkDeskRagStrategy.chunks_update() is an intentional stub raising NotImplementedError. SparkDesk-RAG offers no chunk-level update endpoint, so the adapter cannot fulfill this RagStrategy interface method.","triggerScenarios":"Calling chunks_update(docId, chunkIds, ...) on a SparkDesk-RAG strategy, e.g. editing chunk content or metadata through the generic strategy API.","commonSituations":"Document-editing features built against other RAG backends and later pointed at SparkDesk-RAG via configuration.","solutions":["Delete and re-upload the document instead of updating chunks in place","Gate chunk-update UI/paths off when the backend is SparkDesk-RAG","Add a chunks_update implementation if SparkDesk exposes a chunk-edit API"],"exampleFix":"// before\nawait strategy.chunks_update(docId, chunkIds, content)\n// after\nif not isinstance(strategy, SparkDeskRagStrategy):\n    await strategy.chunks_update(docId, chunkIds, content)\nelse:\n    await strategy.delete_document(docId); await upload_document(...)","handlingStrategy":"validation","validationCode":"if isinstance(strategy, SparkDeskRagStrategy):\n    raise UnsupportedBackendError(\"chunk update not available for SparkDesk-RAG\")","typeGuard":"def is_sparkdesk(strategy) -> bool:\n    return isinstance(strategy, SparkDeskRagStrategy)","tryCatchPattern":"try:\n    await strategy.chunks_update(docId, chunkIds, payload)\nexcept NotImplementedError:\n    await rebuild_document_without_chunk(docId, chunkIds)","preventionTips":["Hide chunk-edit controls when the active RAG backend is SparkDesk","Prefer whole-document replace workflows for SparkDesk","Track chunk metadata locally to reduce backend API dependence"],"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"}