{"record":{"id":"c03063fa484c4d8a","repo":"run-llama/llama_index","slug":"got-empty-streaming-response","errorCode":null,"errorMessage":"Got empty streaming response","messagePattern":"Got empty streaming response","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"llama-index-core/llama_index/core/agent/workflow/base_agent.py","lineNumber":342,"sourceCode":"                raw = (\n                    last_response.raw.model_dump()\n                    if isinstance(last_response.raw, BaseModel)\n                    else last_response.raw\n                )\n                if ctx.is_running:\n                    ctx.write_event_to_stream(\n                        AgentStream(\n                            delta=last_response.delta or \"\",\n                            response=last_response.message.content or \"\",\n                            raw=raw,\n                            current_agent_name=self.name,\n                            thinking_delta=last_response.additional_kwargs.get(\n                                \"thinking_delta\", None\n                            ),\n                        )\n                    )\n            if last_response is None:\n                raise ValueError(\"Got empty streaming response\")\n            return last_response\n        else:\n            return await target_llm.achat(llm_input)\n\n    async def _call_tool(\n        self,\n        ctx: Context,\n        tool: AsyncBaseTool,\n        tool_input: dict,\n    ) -> ToolOutput:\n        \"\"\"Call the given tool with the given input.\"\"\"\n        try:\n            if (\n                isinstance(tool, FunctionTool)\n                and tool.requires_context\n                and tool.ctx_param_name is not None\n            ):\n                new_tool_input = {**tool_input}","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/agent/workflow/base_agent.py#L324-L360","documentation":"MutableMappingKVStore.from_persist_path always raises NotImplementedError; the signature exists purely to satisfy type checkers (note it is even missing a @classmethod decorator). Only concrete stores such as SimpleKVStore implement real from_persist_path construction; calling it on the base class means you attempted to load persisted state into a store type that cannot load it.","triggerScenarios":"Invoking MutableMappingKVStore.from_persist_path('store.json') directly; generic factory code annotated with the base type dispatching to from_persist_path; a custom subclass that inherits the raising implementation.","commonSituations":"Refactors that changed a variable's static type from SimpleKVStore to MutableMappingKVStore; IDE autocompletion offering from_persist_path on the base class; DI containers constructing stores from base-type references.","solutions":["Construct the concrete class: SimpleKVStore.from_persist_path('store.json').","Add a real from_persist_path (with @classmethod) to your custom MutableMappingKVStore subclass that reads the JSON and populates the mapping.","Dispatch on concrete type in factory code instead of the base class."],"exampleFix":"# before\nstore = MutableMappingKVStore.from_persist_path(\"store.json\")  # NotImplementedError\n\n# after\nfrom llama_index.core.storage.kvstore.simple_kvstore import SimpleKVStore\nstore = SimpleKVStore.from_persist_path(\"store.json\")","handlingStrategy":"type-guard","validationCode":"from llama_index.core.storage.kvstore.types import MutableMappingKVStore\nif type(store).from_persist_path is MutableMappingKVStore.from_persist_path:\n    raise TypeError('construct SimpleKVStore explicitly')\nstore = StoreCls.from_persist_path(path)","typeGuard":"def can_load_from_path(store_cls) -> bool:\n    return store_cls.from_persist_path is not MutableMappingKVStore.from_persist_path","tryCatchPattern":"try:\n    store = Store.from_persist_path(p)\nexcept NotImplementedError:\n    store = SimpleKVStore.from_persist_path(p)","preventionTips":["Always construct via the concrete class (SimpleKVStore.from_persist_path).","Add a real @classmethod from_persist_path to custom stores.","Keep factory functions typed to concrete store classes."],"tags":["kvstore","persistence","not-implemented","factory"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}