{"record":{"id":"6f70bb76a621a228","repo":"sgl-project/sglang","slug":"not-model-overridable-declarations-are-lim","errorCode":null,"errorMessage":"{}: {} not model-overridable; declarations are limited to the fields the publish gate accepts.","messagePattern":"(.+?): (.+?) not model-overridable; declarations are limited to the fields the publish gate accepts\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/arg_groups/overrides.py","lineNumber":2991,"sourceCode":"\n\ndef validate_declarations(\n    server_args: Any,\n    declarations: Sequence[Tuple[str, Dict[str, Any]]],\n) -> None:\n    \"\"\"Fail-fast whitelist check at declaration time: a registry typo or a\n    not-yet-resolvable field must be rejected at its slot, not only at\n    publish time. Declarations never mutate ``server_args``.\n    \"\"\"\n    # Non-dataclass fixtures carry no Arg metadata (mirrors the\n    # resolvable_fields escape); only real ServerArgs is validated.\n    if not dataclasses.is_dataclass(type(server_args)):\n        return\n    whitelist = resolvable_fields(type(server_args))\n    for source, decl in declarations:\n        unknown = set(decl) - whitelist\n        if unknown:\n            raise ValueError(\n                f\"{source}: {sorted(unknown)} not model-overridable; \"\n                \"declarations are limited to the fields the publish gate \"\n                \"accepts.\"\n            )\n\n\n@register_post_process\ndef _hrm_text_attention_force(view: Any) -> dict:\n    \"\"\"HRM-Text's bidirectional prefix attention only works on the Triton\n    backend. Invoked as the last attention declaration of the resolution\n    (mirroring the legacy runner-side force, which ran after the whole\n    pipeline).\"\"\"\n    if view.attention_backend not in (None, \"triton\"):\n        logger.warning(\n            f\"Overriding --attention-backend \"\n            f\"{view.attention_backend!r} -> 'triton': only the \"\n            \"Triton backend supports HRM-Text's bidirectional prefix \"\n            \"attention.\"","sourceCodeStart":2973,"sourceCodeEnd":3009,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/arg_groups/overrides.py#L2973-L3009","documentation":"Model-level override declarations in SGLang are restricted to fields the publish gate accepts (resolvable_fields of the ServerArgs dataclass). Declaring an unknown or non-overridable field raises this error naming the offending source and keys.","triggerScenarios":"Calling the declaration API with a dict containing keys that are not in resolvable_fields(ServerArgs), e.g. declaring a computed/runtime-only field as model-overridable.","commonSituations":"Adding a new ServerArgs field and its override declaration in the same change but forgetting the publish-gate registration; renaming a field without updating declarations; typos in declaration keys.","solutions":["Remove the unknown key from the declaration or fix the typo","If the field should be model-overridable, add it to the publish gate so resolvable_fields includes it","Check sorted(unknown) in the message to see exactly which keys failed"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"from sglang.srt.arg_groups.overrides import resolvable_fields\nwhitelist = resolvable_fields(ServerArgs)\ndecl = {k: v for k, v in decl.items() if k in whitelist}","typeGuard":"def is_valid_declaration(decl: dict, server_args_cls) -> bool:\n    return set(decl) <= resolvable_fields(server_args_cls)","tryCatchPattern":"try:\n    declare(...)\nexcept ValueError as e:\n    log.warning(f\"skipping invalid override declaration: {e}\")","preventionTips":["Always intersect declaration keys with resolvable_fields before declaring","Add a unit test asserting declared keys are in the whitelist"],"tags":["sglang","model-overrides","declarations","publish-gate","internal-api"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}