{"record":{"id":"cd98244bc1a09054","repo":"sgl-project/sglang","slug":"global-server-args-is-not-set-yet","errorCode":null,"errorMessage":"Global server args is not set yet!","messagePattern":"Global server args is not set yet!","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/runtime_context.py","lineNumber":804,"sourceCode":"        return stream\n\n    def get_buffer(self, name: str, factory: Any) -> Any:\n        \"\"\"Named process-level persistent buffer: get-or-create via\n        ``factory()``, shared by name (the keyed-lazy pattern of the\n        persistent buffers / named streams).\"\"\"\n        buf = self.resources.buffers.get(name)\n        if buf is None:\n            buf = factory()\n            self.resources.buffers[name] = buf\n        return buf\n\n    @property\n    def server_args(self) -> ServerArgs:\n        \"\"\"The process-wide ``ServerArgs`` (context-owned slot).\"\"\"\n        server_args = self._server_args\n        if server_args is None:\n            # Verbatim legacy message: tests and user scripts may match on it.\n            raise ValueError(\"Global server args is not set yet!\")\n        return server_args\n\n    def set_server_args(self, server_args: ServerArgs) -> None:\n        \"\"\"Publish the process-wide ``ServerArgs`` into the context-owned slot.\n\n        Overwrite-allowed: a re-publish replaces the slot (test kits re-publish\n        per test; production ordering discipline lives at the call-sites, e.g.\n        the draft-worker guard in ``ModelRunner.__init__``). The published\n        object is the raw input; the resolution it carries is its declaration\n        stash, which is what the bags are projected from.\n        \"\"\"\n        # Seed the capture tier for the new lifecycle (defaults for sentinel\n        # and mock publishes, which carry no config).\n        self.flags.capture.enable_torch_compile = getattr(\n            server_args, \"enable_torch_compile\", False\n        )\n        self._server_args = server_args\n        # The adaptive draft-token bound memoizes on the config *path*, so a new","sourceCodeStart":786,"sourceCodeEnd":822,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/runtime_context.py#L786-L822","documentation":"Error \"Global server args is not set yet!\" thrown in sgl-project/sglang.","triggerScenarios":"Thrown at python/sglang/srt/runtime_context.py:804 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}