sgl-project/sglang · error · ValueError

unsupported event kind: {event.kind}

Error message

unsupported event kind: {event.kind}

What it means

ingest_event only recognizes the event kinds 'camera_actions', 'prompt', and the composite input event kind; anything else raises ValueError with the offending kind.

Source

Thrown at python/sglang/multimodal_gen/runtime/entrypoints/openai/realtime/adapters/lingbot_world_realtime_adapter.py:158

        for frame_actions in payload:
            if not isinstance(frame_actions, list):
                raise ValueError("camera_actions event payload must be list[list[str]]")
            normalized.append(list(frame_actions))
        return normalized

    def ingest_event(
        self,
        session: GenerateSession,
        event: RealtimeEvent,
    ) -> str:
        state = self._state(session)
        if event.kind == "camera_actions":
            return self._ingest_camera_actions(state, event.payload, event.event_id)
        elif event.kind == "prompt":
            return self._ingest_prompt(state, event.payload, event.event_id)
        elif event.kind == COMPOSITE_INPUT_EVENT_KIND:
            return self._ingest_composite_input(state, event.payload, event.event_id)
        raise ValueError(f"unsupported event kind: {event.kind}")

    def _ingest_camera_actions(
        self,
        state: LingBotWorldRealtimeState,
        payload: Any,
        event_id: int | None,
    ) -> str:
        return state.receive_camera_control_event_payload(
            payload,
            event_id=event_id,
        )

    def _ingest_prompt(
        self,
        state: LingBotWorldRealtimeState,
        payload: Any,
        event_id: int | None,
    ) -> str:

View on GitHub (pinned to 0132848349)

Solutions

  1. Restrict outgoing events to camera_actions, prompt, and the composite input kind
  2. Check the adapter source/version for the exact COMPOSITE_INPUT_EVENT_KIND constant
  3. Route new modalities through composite_input with declared input_types

Example fix

// before
ws.send(JSON.stringify({kind: "image", payload: data}))
// after
ws.send(JSON.stringify({kind: "composite_input", payload: {input_types: ["prompt"], prompt: "describe this"}}))
Defensive patterns

Strategy: validation

Validate before calling

ALLOWED = {'camera_actions', 'prompt', COMPOSITE_KIND}
assert event['kind'] in ALLOWED, f"unsupported: {event['kind']}"

Type guard

def is_supported_event(kind: str) -> bool: return kind in ('camera_actions', 'prompt', 'composite_input')

Try / catch

try: adapter.ingest_event(...)
except ValueError as e: if 'unsupported event kind' in str(e): drop event, log kind

Prevention

When it happens

Trigger: Sending a websocket/realtime event whose kind is not one of the three supported kinds, e.g. 'image', 'audio', or a typo like 'prompts'.

Common situations: 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.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/e4b2ff4621d65d49. Report an issue: GitHub.