{"record":{"id":"3135db1ddef556a2","repo":"sgl-project/sglang","slug":"hicache-storage-pass-prefix-keys-must-be-bool-got","errorCode":null,"errorMessage":"hicache_storage_pass_prefix_keys must be bool, got {type(hicache_storage_pass_prefix_keys).__name__}","messagePattern":"hicache_storage_pass_prefix_keys must be bool, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/mem_cache/hiradix_cache.py","lineNumber":781,"sourceCode":"\n        if not isinstance(prefetch_threshold, int):\n            raise ValueError(\n                f\"prefetch_threshold must be int, got {type(prefetch_threshold).__name__}\"\n            )\n        if not isinstance(prefetch_timeout_base, (int, float)):\n            raise ValueError(\n                f\"prefetch_timeout_base must be number, got {type(prefetch_timeout_base).__name__}\"\n            )\n        if not isinstance(prefetch_timeout_per_ki_token, (int, float)):\n            raise ValueError(\n                f\"prefetch_timeout_per_ki_token must be number, got {type(prefetch_timeout_per_ki_token).__name__}\"\n            )\n        if not isinstance(prefetch_timeout_max, (int, float)):\n            raise ValueError(\n                f\"prefetch_timeout_max must be number, got {type(prefetch_timeout_max).__name__}\"\n            )\n        if not isinstance(hicache_storage_pass_prefix_keys, bool):\n            raise ValueError(\n                \"hicache_storage_pass_prefix_keys must be bool, got \"\n                f\"{type(hicache_storage_pass_prefix_keys).__name__}\"\n            )\n\n        prefetch_timeout_config = PrefetchTimeoutConfig(\n            base=float(prefetch_timeout_base),\n            per_ki_token=float(prefetch_timeout_per_ki_token),\n            max=float(prefetch_timeout_max),\n        )\n\n        return (\n            extra_config,\n            prefetch_threshold,\n            prefetch_timeout_config,\n            hicache_storage_pass_prefix_keys,\n        )\n\n    def reset(self):","sourceCodeStart":763,"sourceCodeEnd":799,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/mem_cache/hiradix_cache.py#L763-L799","documentation":"Validates that hicache_storage_pass_prefix_keys in the parsed extra config is strictly a bool. Python bools are required, so 0/1, \"true\"/\"false\" strings, or yes/no (which YAML may or may not coerce depending on quoting) fail the isinstance(x, bool) check.","triggerScenarios":"Extra config with hicache_storage_pass_prefix_keys: \"true\" (quoted string), 1/0 (int), or 'yes' handled as string in TOML/JSON where only true/false booleans exist.","commonSituations":"Quoting booleans in YAML; using 0/1 flags from CLI-style thinking; JSON configs generated by tools that emit strings for flags; TOML requires lowercase true/false — True/TRUE in some generators become strings.","solutions":["Use an unquoted boolean literal: hicache_storage_pass_prefix_keys: true (YAML) or true (JSON/TOML lowercase)","Never quote the value or substitute 1/0","Regenerate tool-produced configs so booleans stay native JSON/TOML booleans"],"exampleFix":"# before\nhicache_storage_pass_prefix_keys: \"true\"\n\n# after\nhicache_storage_pass_prefix_keys: true","handlingStrategy":"type-guard","validationCode":"v = cfg.get(\"hicache_storage_pass_prefix_keys\", False)\nassert isinstance(v, bool), \"hicache_storage_pass_prefix_keys must be a real bool (true/false, unquoted)\"","typeGuard":"def is_strict_bool(v) -> bool:\n    return isinstance(v, bool)","tryCatchPattern":null,"preventionTips":["Use lowercase true/false in YAML/TOML/JSON, never quoted and never 0/1","Prefer native booleans over string flags in generated configs"],"tags":["hicache","config-validation","boolean","type-error"],"backgroundTag":"config-type-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}