{"record":{"id":"a5789f4eb2053057","repo":"stanford-oval/storm","slug":"child-node-with-name-node-name-not-found","errorCode":null,"errorMessage":"Child node with name {node_name} not found.","messagePattern":"Child node with name (.+?) not found\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/collaborative_storm/modules/information_insertion_module.py","lineNumber":135,"sourceCode":"\r\n        while True:\r\n            action_type, node_name = self._get_navigation_choice(\r\n                knowledge_node=current_node, question=question, query=query\r\n            )\r\n            if action_type == \"insert\":\r\n                return dspy.Prediction(\r\n                    information_placement=\" -> \".join(\r\n                        current_node.get_path_from_root(root)\r\n                    ),\r\n                    note=\"None\",\r\n                )\r\n            elif action_type == \"step\":\r\n                for child in current_node.children:\r\n                    if child.name == node_name:\r\n                        current_node = child\r\n                        break\r\n                else:\r\n                    raise ValueError(f\"Child node with name {node_name} not found.\")\r\n            elif action_type == \"create\":\r\n                placement_path = current_node.get_path_from_root(root)\r\n                if allow_create_new_node:\r\n                    placement_path.append(node_name)\r\n                    note = f\"create new node: {{{node_name}}} under {{{current_node.name}}}\"\r\n                else:\r\n                    note = f\"attempt to create new node: {{{node_name}}} under {{{current_node.name}}}\"\r\n                return dspy.Prediction(\r\n                    information_placement=\" -> \".join(placement_path), note=note\r\n                )\r\n            else:\r\n                raise ValueError(f\"Unknown action type: {action_type}\")\r\n\r\n    def _get_sorted_embed_sim_section(\r\n        self,\r\n        encoded_outline: np.ndarray,\r\n        outlines: List[str],\r\n        question: str,\r","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/information_insertion_module.py#L117-L153","documentation":"During layer-by-layer navigation, an action 'step: <node_name>' instructs the module to descend into a child node, but no child of the current node has that name, so it raises ValueError.","triggerScenarios":"Calling layer_by_layer_navigation_placement (via process_intent) when the LM emits a step to a node name that doesn't exist under the current node — often due to case/whitespace differences or hallucinated node names.","commonSituations":"LLM hallucinates or slightly misspells a node name from the outline, or the knowledge base changed between prompt construction and action execution.","solutions":["Normalize names (strip/casefold) when comparing before calling, or sanitize the LLM's node_name against current_node.children names","Retry the navigation decision so the LLM sees the error and corrects itself","Catch this ValueError and treat it as 'create' (or root placement) as a fallback"],"exampleFix":"# before\nresult = module.layer_by_layer_navigation_placement(kb, q, info)\n\n# after\ntry:\n    result = module.layer_by_layer_navigation_placement(kb, q, info)\nexcept ValueError:\n    result = module.layer_by_layer_navigation_placement(kb, q, info)  # retry with error context","handlingStrategy":"try-catch","validationCode":"names = {c.name.strip().lower() for c in current_node.children}\nassert node_name.strip().lower() in names, f'unknown child {node_name}'","typeGuard":"def child_exists(node, name) -> bool:\n    return any(c.name == name for c in node.children)","tryCatchPattern":"try:\n    result = module.layer_by_layer_navigation_placement(kb, q, info)\nexcept ValueError as e:\n    if 'not found' in str(e):\n        result = retry_or_default_placement()\n    else:\n        raise","preventionTips":["Normalize node names (strip/case) before stepping","Verify children exist before emitting 'step' actions","Retry navigation on mismatch"],"tags":["co-storm","tree-navigation","node-not-found"],"backgroundTag":"node-not-found-in-tree","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}