{"record":{"id":"0f9eedcbdc191ff1","repo":"sgl-project/sglang","slug":"detail","errorCode":null,"errorMessage":"{detail}","messagePattern":"\\{detail\\}","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/action/api.py","lineNumber":228,"sourceCode":"                payload = await _multipart_action_payload(request, uploads_dir)\n            elif \"msgpack\" in content_type:\n                payload = unpack_msgpack(await request.body())\n            else:\n                payload = await request.json()\n            wants_msgpack = _wants_msgpack(request)\n            if wants_msgpack:\n                _prefer_numpy_output(payload)\n            output = await infer_action(payload, server_args)\n            if _response_format(payload) == \"raw\":\n                response = action_raw_response(output, preserve_numpy=wants_msgpack)\n            else:\n                response = action_generation_response(\n                    output,\n                    server_args,\n                    preserve_numpy=wants_msgpack,\n                )\n    except ValueError as exc:\n        raise HTTPException(status_code=400, detail=str(exc)) from exc\n    if wants_msgpack:\n        return Response(\n            content=pack_msgpack(response), media_type=\"application/msgpack\"\n        )\n    return orjson_response(response)\n\n\n@router.get(\"/metadata\")\nasync def action_metadata_endpoint(request: Request):\n    return orjson_response(action_metadata(request.app.state.server_args))\n\n\n@router.websocket(\"/realtime\")\nasync def action_realtime_ws(websocket: WebSocket):\n    server_args: ServerArgs = websocket.app.state.server_args\n    await run_action_msgpack_ws(\n        websocket,\n        server_args,","sourceCodeStart":210,"sourceCodeEnd":246,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/action/api.py#L210-L246","documentation":"Generic HTTP 400 wrapper: create_action_generation catches any ValueError from request parsing or generation-prep (response_format, extra_params, cosmos3 observation/prompt validation, sampling params) and re-raises it as HTTPException(400, detail=str(exc)). The detail text identifies the underlying validation failure.","triggerScenarios":"Any malformed action-generation request: bad runtime.response_format, invalid extra_params JSON, wrong image dtype/shape, bad prompt type, or invalid sampling parameters.","commonSituations":"Client-side payload construction bugs; integration testing against the action endpoint with improperly formatted observations or params.","solutions":["Read the detail field in the 400 response; it re-states the specific ValueError message (e.g. image dtype, JSON parse)","Fix the flagged field per that specific message","Re-send with a minimal known-good payload first, then add fields back to isolate the offending one"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    resp = requests.post(ACTION_URL, json=payload, timeout=30)\n    resp.raise_for_status()\nexcept requests.HTTPError:\n    detail = resp.json().get(\"detail\", \"\")\n    logger.warning(\"action request rejected: %s\", detail)\n    # detail names the exact offending field; fix and retry once","preventionTips":["Log and surface the 400 detail message — it pinpoints the bad field","Build requests with a shared, tested client helper","Smoke-test payloads against a dev endpoint before production"],"tags":["api","http-400","request-validation","error-wrapper"],"backgroundTag":"http-400-bad-request","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}