iflytek/astron-agent · error · NotImplementedError

SparkDesk-RAG does not support query_doc_name operation.

Error message

SparkDesk-RAG does not support query_doc_name operation.

What it means

SparkDeskRagStrategy.query_doc_name() is an intentional stub raising NotImplementedError. SparkDesk-RAG exposes no API to fetch document-name metadata by docId, so the adapter leaves the interface method unimplemented.

Solutions

  1. Store the document name locally at upload time and look it up in your own DB
  2. Skip name resolution when the backend is SparkDesk-RAG
  3. Implement query_doc_name if SparkDesk exposes a document-metadata endpoint

Example fix

// before
info = await strategy.query_doc_name(docId)
// after
info = await doc_db.get_name(docId) if isinstance(strategy, SparkDeskRagStrategy) else await strategy.query_doc_name(docId)
Defensive patterns

Strategy: fallback

Validate before calling

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

Type guard

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

Try / catch

try:
    info = await strategy.query_doc_name(docId)
except NotImplementedError:
    info = await doc_db.get_name(docId)  # local fallback

Prevention

When it happens

Trigger: Calling query_doc_name(docId) on a SparkDesk-RAG strategy to resolve a document's display name.

Common situations: UI code resolving file names from docIds via the generic strategy interface; features ported from other RAG backends without backend capability checks.

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/d2d2ede72a689e6f. Report an issue: GitHub.

Appendix: source

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

            NotImplementedError: SparkDesk-RAG does not support document query operation
        """
        raise NotImplementedError("SparkDesk-RAG does not support query_doc operation.")

    async def query_doc_name(self, docId: str, **kwargs: Any) -> Optional[dict]:
        """
        Query document name information

        Args:
            doc_id: Document ID
            **kwargs: Other parameters

        Returns:
            File information object

        Raises:
            NotImplementedError: SparkDesk-RAG does not support document name query operation
        """
        raise NotImplementedError(
            "SparkDesk-RAG does not support query_doc_name operation."
        )

View on GitHub (pinned to 5e758547a8)