{"record":{"id":"c2c202c12590a5ca","repo":"stanford-oval/storm","slug":"unknown-action-type-action-type","errorCode":null,"errorMessage":"Unknown action type: {action_type}","messagePattern":"Unknown action type: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"knowledge_storm/collaborative_storm/modules/information_insertion_module.py","lineNumber":147,"sourceCode":"            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\n        query: str,\r\n    ):\r\n        if encoded_outline is not None and encoded_outline.size > 0:\r\n            encoded_query = self.encoder.encode(f\"{question}, {query}\")\r\n            sim = cosine_similarity([encoded_query], encoded_outline)[0]\r\n            sorted_indices = np.argsort(sim)\r\n            sorted_outlines = np.array(outlines)[sorted_indices[::-1]]\r\n            return sorted_outlines\r\n        else:\r\n            return outlines\r\n\r\n    def _parse_selected_index(self, string: str):\r","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/modules/information_insertion_module.py#L129-L165","documentation":"layer_by_layer_navigation_placement only understands 'node', 'step', and 'create' action types; any other string reaches the else branch and raises ValueError('Unknown action type').","triggerScenarios":"Directly calling layer_by_layer_navigation_placement with a custom (action_type, node_name) tuple whose action_type isn't one of the three supported values, or upstream parsing changes introducing new labels.","commonSituations":"User code constructs navigation intents manually or monkey-patches/extends action labels without updating the dispatcher.","solutions":["Restrict action types to 'node', 'step', 'create' before calling","If you need custom actions, subclass/patch layer_by_layer_navigation_placement to handle them"],"exampleFix":"# before\nmodule.layer_by_layer_navigation_placement(kb, q, info, actions=[('insert', 'History')])\n\n# after\nmodule.layer_by_layer_navigation_placement(kb, q, info, actions=[('create', 'History')])","handlingStrategy":"validation","validationCode":"VALID = {'node', 'step', 'create'}\nactions = [(a, n) for a, n in actions if a in VALID]","typeGuard":"def is_known_action(action_type: str) -> bool:\n    return action_type in {'node', 'step', 'create'}","tryCatchPattern":"try:\n    module.layer_by_layer_navigation_placement(kb, q, info, actions=acts)\nexcept ValueError as e:\n    if 'Unknown action type' not in str(e):\n        raise\n    acts = [(a if a in VALID else 'create', n) for a, n in acts]","preventionTips":["Whitelist action types before calling","Keep custom action vocabularies in sync with the module"],"tags":["co-storm","invalid-argument","navigation"],"backgroundTag":"invalid-enum-value","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}