iflytek/astron-agent · error · NotImplementedError

SparkDesk-RAG does not support chunks_update operation.

Error message

SparkDesk-RAG does not support chunks_update operation.

What it means

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.

Solutions

  1. Delete and re-upload the document instead of updating chunks in place
  2. Gate chunk-update UI/paths off when the backend is SparkDesk-RAG
  3. Add a chunks_update implementation if SparkDesk exposes a chunk-edit API

Example fix

// before
await strategy.chunks_update(docId, chunkIds, content)
// after
if not isinstance(strategy, SparkDeskRagStrategy):
    await strategy.chunks_update(docId, chunkIds, content)
else:
    await strategy.delete_document(docId); await upload_document(...)
Defensive patterns

Strategy: validation

Validate before calling

if isinstance(strategy, SparkDeskRagStrategy):
    raise UnsupportedBackendError("chunk update not available for SparkDesk-RAG")

Type guard

def is_sparkdesk(strategy) -> bool:
    return isinstance(strategy, SparkDeskRagStrategy)

Try / catch

try:
    await strategy.chunks_update(docId, chunkIds, payload)
except NotImplementedError:
    await rebuild_document_without_chunk(docId, chunkIds)

Prevention

When it happens

Trigger: Calling chunks_update(docId, chunkIds, ...) on a SparkDesk-RAG strategy, e.g. editing chunk content or metadata through the generic strategy API.

Common situations: Document-editing features built against other RAG backends and later pointed at SparkDesk-RAG via configuration.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/85a72c413dbd445e. Report an issue: GitHub.

Appendix: source

Thrown at core/knowledge/service/impl/sparkdesk_strategy.py:120

        **kwargs: Any
    ) -> Any:
        """
        Update chunks

        Args:
            doc_id: Document ID
            group: Group name
            uid: User ID
            chunks: Chunk list
            **kwargs: Other parameters

        Returns:
            Update result

        Raises:
            NotImplementedError: SparkDesk-RAG does not support update operation
        """
        raise NotImplementedError(
            "SparkDesk-RAG does not support chunks_update operation."
        )

    async def chunks_delete(
        self, docId: str, chunkIds: List[str], **kwargs: Any
    ) -> Any:
        """
        Delete chunks

        Args:
            doc_id: Document ID
            chunk_ids: Chunk ID list
            **kwargs: Other parameters

        Returns:
            Delete result

        Raises:

View on GitHub (pinned to 5e758547a8)