AI & Agent Dev Bug Sandbox logo
AI & Agent Dev Bug Sandbox
Back to Radar

[Bug]: HierarchicalNodeParser Async Methods Return The Documents Unsplit

Async entry points (`aget_nodes_from_documents`, `acall`, and `IngestionPipeline.arun`) ignore the hierarchical parsing logic and return original `Document` objects unchanged, causing async ingestion pipelines to index whole documents without parent/child relationships.

highConfidence 92%Llama-IndexData ConnectorsWorkflowsVectorStoreIndexAffected V0.14.25

Origin Analysis

`HierarchicalNodeParser` only overrides the synchronous `get_nodes_from_documents`. The inherited async methods call `_aparse_nodes`, which falls back to `_parse_nodes` (a stub that returns input nodes unchanged). Therefore the async path never invokes `_recursively_get_nodes_from_nodes`.
Run the provided script: create a Document with 400 sentences, instantiate HierarchicalNodeParser.from_defaults(chunk_sizes=[512,128]), compare `parser.get_nodes_from_documents([doc])` (returns 69 TextNodes) with `await parser.aget_nodes_from_documents([doc])`, `await parser.acall([doc])`, and `await IngestionPipeline(transformations=[parser]).arun(documents=[doc])`. The async results contain 1 node of type Document and that node is the same object as the input doc.

Fixing Code Block

Edge Case Audit

This delegates to the sync method in a thread pool; under extremely high concurrency it can consume a thread per call, potentially exhausting the default executor. The sync method is relatively CPU/memory heavy for large documents. Consider using a semaphore or implementing a native async recursive split in high-throughput services. Rollback: remove this override; no data migration or configuration changes are needed.

Ecosystem Topology

Agent Frameworks

LangChain, LlamaIndex, and Pydantic

  1. highProperty graph relation keys collide when entity IDs or labels contain underscores
  2. highCodeActAgent drops assistant tool-call metadata during handoff, leaving an orphan tool response
  3. high[Bug]: HierarchicalNodeParser async methods return the documents unsplit
  4. highLLM.predict_and_call fails with ValidationError for non-function-calling models when react_chat_formatter is omitted
  5. highAnthropic streaming server-tool input_json_delta overwrites completed client tool_use arguments due to stale cur_tool_call state