{"record":{"id":"2aae88808a514cf8","repo":"sgl-project/sglang","slug":"harmony-does-not-support-reasoning-effort-reasoni","errorCode":null,"errorMessage":"Harmony does not support reasoning effort {reasoning_effort}","messagePattern":"Harmony does not support reasoning effort (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"python/sglang/srt/entrypoints/openai/serving_chat.py","lineNumber":977,"sourceCode":"            return None\n\n        return (\n            \"Model only supports text input; \"\n            f\"received unsupported content type '{media_type}'.\"\n        )\n\n    def _convert_to_internal_request(\n        self,\n        request: ChatCompletionRequest,\n        raw_request: Request = None,\n    ) -> tuple[GenerateReqInput, ChatCompletionRequest]:\n        reasoning_effort = (\n            request.chat_template_kwargs.pop(\"reasoning_effort\", None)\n            if request.chat_template_kwargs\n            else None\n        )\n        if self.is_gpt_oss and reasoning_effort == \"none\":\n            raise ValueError(\n                f\"Harmony does not support reasoning effort {reasoning_effort}\"\n            )\n\n        if reasoning_effort is not None:\n            request.reasoning_effort = reasoning_effort\n\n        if request.stream:\n            if request.return_prompt_token_ids:\n                raise ValueError(\n                    \"return_prompt_token_ids is not supported with streaming. \"\n                    \"Please set stream=false when using return_prompt_token_ids=true.\"\n                )\n            if request.return_token_ids:\n                raise ValueError(\n                    \"return_token_ids is not supported with streaming on \"\n                    \"/v1/chat/completions. Please set stream=false when using \"\n                    \"return_token_ids=true.\"\n                )","sourceCodeStart":959,"sourceCodeEnd":995,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/entrypoints/openai/serving_chat.py#L959-L995","documentation":"For gpt-oss (Harmony-format) models, SGLang rejects reasoning_effort='none' popped from chat_template_kwargs. The Harmony format has no 'none' effort level — disabling reasoning must be done via other means.","triggerScenarios":"POST /v1/chat/completions against a gpt-oss model with chat_template_kwargs={\"reasoning_effort\": \"none\"}.","commonSituations":"Porting prompts tuned for other models where effort 'none' disables thinking; clients sending 'none' uniformly to skip reasoning; misreading the effort label set.","solutions":["Remove reasoning_effort from chat_template_kwargs for gpt-oss","To suppress reasoning output, filter/hide reasoning channels in the response or use the model's supported low effort ('low')","Use a supported Harmony effort level such as 'low', 'medium', 'high'"],"exampleFix":"// before\n{\"chat_template_kwargs\": {\"reasoning_effort\": \"none\"}}\n// after\n{\"chat_template_kwargs\": {\"reasoning_effort\": \"low\"}}","handlingStrategy":"validation","validationCode":"if model_is_gpt_oss:\n    kwargs = req.pop(\"chat_template_kwargs\", None) or {}\n    kwargs.pop(\"reasoning_effort\", None) if kwargs.get(\"reasoning_effort\") == \"none\" else None","typeGuard":"def safe_gpt_oss_effort(e): return e != \"none\"","tryCatchPattern":"except ValueError as e: if 'does not support reasoning effort' in str(e): retry with 'low'","preventionTips":["Per-model allowlists for reasoning_effort","Never send 'none' to gpt-oss; use 'low' or filter reasoning from output"],"tags":["gpt-oss","harmony","reasoning","openai-api","sglang"],"backgroundTag":"unsupported-parameter-value","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}