langchain-ai/deepagents · error · ValueError
Unsupported notification type: {value}
Error message
Unsupported notification type: {value} What it means
`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.
Source
Thrown at libs/code/deepagents_code/hooks/projection.py:408
Raises:
ValueError: If the notification type is unsupported.
"""
mappings: dict[str, WireNotificationType] = {
DcodeNotificationKind.PERMISSION_REQUIRED: (
WireNotificationType.PERMISSION_PROMPT
),
WireNotificationType.PERMISSION_PROMPT: WireNotificationType.PERMISSION_PROMPT,
DcodeNotificationKind.AGENT_NEEDS_INPUT: WireNotificationType.AGENT_NEEDS_INPUT,
DcodeNotificationKind.AGENT_COMPLETED: WireNotificationType.AGENT_COMPLETED,
DcodeNotificationKind.COLD_CACHE_WARNING: (
WireNotificationType.COLD_CACHE_WARNING
),
}
try:
return mappings[value]
except KeyError as exc:
msg = f"Unsupported notification type: {value}"
raise ValueError(msg) from exc
View on GitHub (pinned to a1af029e6e)
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
Example fix
// before match_target(hook, "permission_reqest") // after from deepagents_code.hooks import NotificationType match_target(hook, NotificationType.PERMISSION_REQUEST)
Defensive patterns
Strategy: validation
Validate before calling
from deepagents_code.hooks.projection import to_wire_notification_type
try:
to_wire_notification_type(value)
except ValueError:
raise ValueError(f"unsupported notification type: {value!r}") Try / catch
try:
wire_type = to_wire_notification_type(value)
except ValueError as e:
logger.error("bad notification type in hook target: %s", e)
raise Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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"`.
Related errors
- SubagentStop requires a materialized agent transcript path
- Unsupported hook event: {event}
- Could not parse embedded resource block. Block expected eith
- question text must not be blank
- choice has a blank 'value': {choice!r}
AI-assisted analysis of langchain-ai/deepagents@a1af029e6e (2026-08-29).
Data as JSON: /api/errors/21a24e2996033e70.
Report an issue: GitHub.