{"record":{"id":"6ab9597544829348","repo":"vllm-project/vllm","slug":"unsupported-new-block-ids-type-type-new-block-ids","errorCode":null,"errorMessage":"Unsupported new_block_ids type {type(new_block_ids)}: should be None[list[int], ...], tuple or list[int].","messagePattern":"Unsupported new_block_ids type (.+?): should be None\\[list\\[int\\], \\.\\.\\.\\], tuple or list\\[int\\]\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py","lineNumber":236,"sourceCode":"    ) -> None:\n        \"\"\"Update the request tracker when a running request is\n        scheduled again\n        \"\"\"\n\n        self.token_ids.extend(new_token_ids)\n\n        if new_block_ids is None:\n            # https://github.com/vllm-project/vllm/commit/\n            # b029de9902aa3ac58806c8c17776c7074175b6db\n            new_block_ids = []\n        elif len(new_block_ids) == 0:\n            new_block_ids = []\n        elif isinstance(new_block_ids, tuple):\n            new_block_ids = new_block_ids[0]\n        elif isinstance(new_block_ids, list):\n            pass\n        else:\n            raise ValueError(\n                f\"Unsupported new_block_ids type {type(new_block_ids)}: \"\n                f\"should be None[list[int], ...], tuple or list[int].\"\n            )\n        self.allocated_block_ids.extend(new_block_ids)\n\n        # When a request is scheduled again, and the number of new tokens\n        # is 1 (excluding chunked prefill), the request is in decode phase.\n        if len(new_token_ids) == 1:\n            self.is_decode_phase = True\n\n\n@dataclass\nclass ReqMeta:\n    # Request id\n    req_id: str\n    # Request tokens\n    token_ids: list[int]  # torch.Tensor\n    # Slot mapping","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/vllm-project/vllm/blob/c794754062d49a8fdb63ab3c5215b488b865030c/vllm/distributed/kv_transfer/kv_connector/v1/lmcache_integration/vllm_v1_adapter.py#L218-L254","documentation":"ValueError raised in LMCache's VLLM v1 adapter request-tracker update when new_block_ids arrives in a type other than None, tuple, or list (the three shapes the scheduler is known to emit). The adapter normalizes each shape (None -> [], tuple -> first element, list kept) and this error fires only for genuinely unexpected types, meaning scheduler/adapter version drift or a corrupted metadata object. It protects allocated_block_ids from being extended with garbage.","triggerScenarios":"Scheduler sends new_block_ids as a dict, generator, ndarray, or custom object after a vLLM internal API change; downstream code mutates scheduler_output.new_block_ids[i] into an unexpected container; running an LMCache integration built against a different vLLM scheduler contract.","commonSituations":"Version mismatch between the lmcache package and vLLM's scheduler output format; monkey-patching or custom schedulers that emit non-standard block id containers.","solutions":["Pin lmcache and vllm to a known-compatible version pair (check the LMCache release notes for the supported vLLM version).","If you control the caller, ensure new_block_ids is None, a tuple of per-slide lists, or a flat list[int].","Log type(new_block_ids) and its repr before the call to confirm what the scheduler actually sent."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def is_supported_block_ids(v) -> bool:\n    return v is None or isinstance(v, (tuple, list))","tryCatchPattern":"Catch ValueError at the adapter boundary and log type(new_block_ids) — this is version drift; fix by pinning compatible vllm/lmcache versions rather than catching at runtime.","preventionTips":["Pin lmcache to the version tested against your vLLM release","Run the connector integration tests after upgrading either package"],"tags":["lmcache","version-mismatch","type-validation","scheduler","kv-transfer"],"backgroundTag":null,"analyzedSha":"c794754062d49a8fdb63ab3c5215b488b865030c","analyzedAt":"2026-08-14T21:17:39.825Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}