{"record":{"id":"885207434c5c5004","repo":"sgl-project/sglang","slug":"unknown-channel-message-channel","errorCode":null,"errorMessage":"Unknown channel: {message.channel}","messagePattern":"Unknown channel: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/entrypoints/harmony_utils.py","lineNumber":349,"sourceCode":"        contents = []\n        for content in message.content:\n            output_text = ResponseOutputText(\n                text=content.text,\n                annotations=[],  # TODO\n                type=\"output_text\",\n                logprobs=None,  # TODO\n            )\n            contents.append(output_text)\n        text_item = ResponseOutputMessage(\n            id=f\"msg_{random_uuid()}\",\n            content=contents,\n            role=message.author.role,\n            status=\"completed\",\n            type=\"message\",\n        )\n        output_items.append(text_item)\n    else:\n        raise ValueError(f\"Unknown channel: {message.channel}\")\n    return output_items\n\n\ndef parse_remaining_state(parser: StreamableParser):\n    if not parser.current_content:\n        return []\n    if parser.current_role != Role.ASSISTANT:\n        return []\n    current_recipient = parser.current_recipient\n    if current_recipient is not None and current_recipient.startswith(\"browser.\"):\n        return []\n\n    if parser.current_channel == \"analysis\":\n        reasoning_item = ResponseReasoningItem(\n            id=f\"rs_{random_uuid()}\",\n            type=\"reasoning\",\n            summary=[],\n            content=[","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/entrypoints/harmony_utils.py#L331-L367","documentation":"parse_output_message only converts messages on the 'commentary' and 'final' channels; a message on any other channel (e.g. 'analysis' or a typo) falls through to this ValueError. The channel field is the top-level dispatch key for output formatting.","triggerScenarios":"A parsed harmony Message whose channel is anything other than 'commentary' or 'final' when handed to _make_response_output_items_with_harmony.","commonSituations":"Malformed model output emitting an unexpected channel token; older/newer harmony format versions using different channel names; custom harmony post-processing setting wrong channel values.","solutions":["Normalize message.channel to 'commentary' or 'final' before parsing","If the model emits a legitimate new channel, add a handling branch in harmony_utils.py","Upgrade sglang to match the harmony format version your model was trained on"],"exampleFix":"# before\nmsg = msg.copy_with(channel=\"analysis\")\n# after\nmsg = msg.copy_with(channel=\"commentary\")","handlingStrategy":"validation","validationCode":"assert message.channel in {\"commentary\", \"final\"}, f\"unexpected channel {message.channel!r}\"","typeGuard":"def is_supported_channel(message) -> bool:\n    return message.channel in {\"commentary\", \"final\"}","tryCatchPattern":"try:\n    items = parse_output_message(message)\nexcept ValueError as e:\n    if \"Unknown channel\" in str(e):\n        message = message.copy_with(channel=\"commentary\")\n        items = parse_output_message(message)\n    else:\n        raise","preventionTips":["Normalize channel to commentary/final in harmony post-processing","Keep the harmony format version aligned between model and sglang runtime"],"tags":["harmony","channel-routing","message-parsing","sglang"],"backgroundTag":"unknown-message-channel","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}