{"record":{"id":"e4b2ff4621d65d49","repo":"sgl-project/sglang","slug":"unsupported-event-kind-event-kind","errorCode":null,"errorMessage":"unsupported event kind: {event.kind}","messagePattern":"unsupported event kind: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/openai/realtime/adapters/lingbot_world_realtime_adapter.py","lineNumber":158,"sourceCode":"        for frame_actions in payload:\n            if not isinstance(frame_actions, list):\n                raise ValueError(\"camera_actions event payload must be list[list[str]]\")\n            normalized.append(list(frame_actions))\n        return normalized\n\n    def ingest_event(\n        self,\n        session: GenerateSession,\n        event: RealtimeEvent,\n    ) -> str:\n        state = self._state(session)\n        if event.kind == \"camera_actions\":\n            return self._ingest_camera_actions(state, event.payload, event.event_id)\n        elif event.kind == \"prompt\":\n            return self._ingest_prompt(state, event.payload, event.event_id)\n        elif event.kind == COMPOSITE_INPUT_EVENT_KIND:\n            return self._ingest_composite_input(state, event.payload, event.event_id)\n        raise ValueError(f\"unsupported event kind: {event.kind}\")\n\n    def _ingest_camera_actions(\n        self,\n        state: LingBotWorldRealtimeState,\n        payload: Any,\n        event_id: int | None,\n    ) -> str:\n        return state.receive_camera_control_event_payload(\n            payload,\n            event_id=event_id,\n        )\n\n    def _ingest_prompt(\n        self,\n        state: LingBotWorldRealtimeState,\n        payload: Any,\n        event_id: int | None,\n    ) -> str:","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/openai/realtime/adapters/lingbot_world_realtime_adapter.py#L140-L176","documentation":"ingest_event only recognizes the event kinds 'camera_actions', 'prompt', and the composite input event kind; anything else raises ValueError with the offending kind.","triggerScenarios":"Sending a websocket/realtime event whose kind is not one of the three supported kinds, e.g. 'image', 'audio', or a typo like 'prompts'.","commonSituations":"Porting a client from another realtime API with different event names; adapter version that hasn't yet added a new event type the client sends.","solutions":["Restrict outgoing events to camera_actions, prompt, and the composite input kind","Check the adapter source/version for the exact COMPOSITE_INPUT_EVENT_KIND constant","Route new modalities through composite_input with declared input_types"],"exampleFix":"// before\nws.send(JSON.stringify({kind: \"image\", payload: data}))\n// after\nws.send(JSON.stringify({kind: \"composite_input\", payload: {input_types: [\"prompt\"], prompt: \"describe this\"}}))","handlingStrategy":"validation","validationCode":"ALLOWED = {'camera_actions', 'prompt', COMPOSITE_KIND}\nassert event['kind'] in ALLOWED, f\"unsupported: {event['kind']}\"","typeGuard":"def is_supported_event(kind: str) -> bool: return kind in ('camera_actions', 'prompt', 'composite_input')","tryCatchPattern":"try: adapter.ingest_event(...)\nexcept ValueError as e: if 'unsupported event kind' in str(e): drop event, log kind","preventionTips":["Whitelist event kinds client-side","Check adapter version for newly added kinds"],"tags":["realtime","event-routing","unsupported-event","websocket"],"backgroundTag":"unsupported-event-kind","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}