{"record":{"id":"21a24e2996033e70","repo":"langchain-ai/deepagents","slug":"unsupported-notification-type-value","errorCode":null,"errorMessage":"Unsupported notification type: {value}","messagePattern":"Unsupported notification type: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/code/deepagents_code/hooks/projection.py","lineNumber":408,"sourceCode":"    Raises:\n        ValueError: If the notification type is unsupported.\n    \"\"\"\n    mappings: dict[str, WireNotificationType] = {\n        DcodeNotificationKind.PERMISSION_REQUIRED: (\n            WireNotificationType.PERMISSION_PROMPT\n        ),\n        WireNotificationType.PERMISSION_PROMPT: WireNotificationType.PERMISSION_PROMPT,\n        DcodeNotificationKind.AGENT_NEEDS_INPUT: WireNotificationType.AGENT_NEEDS_INPUT,\n        DcodeNotificationKind.AGENT_COMPLETED: WireNotificationType.AGENT_COMPLETED,\n        DcodeNotificationKind.COLD_CACHE_WARNING: (\n            WireNotificationType.COLD_CACHE_WARNING\n        ),\n    }\n    try:\n        return mappings[value]\n    except KeyError as exc:\n        msg = f\"Unsupported notification type: {value}\"\n        raise ValueError(msg) from exc\n","sourceCodeStart":390,"sourceCodeEnd":409,"githubUrl":"https://github.com/langchain-ai/deepagents/blob/a1af029e6e73cb17c36bff823d227747b28e91e1/libs/code/deepagents_code/hooks/projection.py#L390-L409","documentation":"`to_wire_notification_type` maps internal notification type values to their wire-format names expected by external hook consumers. An unmapped `value` raises `ValueError`, meaning a notification type reached the projection/matching layer that the wire schema does not define.","triggerScenarios":"Projecting a notification or matching a hook target whose `notification_type` is not one of the keys in the `mappings` table — e.g. a new or custom notification type, a typo, or a value added in a newer library version.","commonSituations":"Configuring hook matchers with a hand-written notification type string that differs from the supported enum; version mismatch between code producing events and the hook projection schema; typos like `\"permisson_request\"`.","solutions":["Use one of the supported notification type values from the mappings table (import the enum/constant rather than hard-coding strings)","Register the new type in `to_wire_notification_type`'s mappings if it is a legitimately new type","Check for typos and version alignment between the producer of the event and the hook library"],"exampleFix":"// before\nmatch_target(hook, \"permission_reqest\")\n// after\nfrom deepagents_code.hooks import NotificationType\nmatch_target(hook, NotificationType.PERMISSION_REQUEST)","handlingStrategy":"validation","validationCode":"from deepagents_code.hooks.projection import to_wire_notification_type\ntry:\n    to_wire_notification_type(value)\nexcept ValueError:\n    raise ValueError(f\"unsupported notification type: {value!r}\")","typeGuard":null,"tryCatchPattern":"try:\n    wire_type = to_wire_notification_type(value)\nexcept ValueError as e:\n    logger.error(\"bad notification type in hook target: %s\", e)\n    raise","preventionTips":["Use the library's NotificationType constants instead of raw strings","Validate hook target configs at load time against supported types","Watch for renames when upgrading the library"],"tags":["valueerror","hooks","mapping","notification"],"backgroundTag":"unsupported-event-type","analyzedSha":"a1af029e6e73cb17c36bff823d227747b28e91e1","analyzedAt":"2026-08-29T11:43:24.718Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}