{"record":{"id":"92976112fa145afc","repo":"microsoft/graphrag","slug":"ratelimitconfig-type-strategy-is-not-registere","errorCode":null,"errorMessage":"RateLimitConfig.type '{strategy}' is not registered in the RateLimitFactory. Registered strategies: {', '.join(rate_limit_factory.keys())}","messagePattern":"RateLimitConfig\\.type '(.+?)' is not registered in the RateLimitFactory\\. Registered strategies: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag-llm/graphrag_llm/rate_limit/rate_limit_factory.py","lineNumber":82,"sourceCode":"    \"\"\"\n    strategy = rate_limit_config.type\n    init_args = rate_limit_config.model_dump()\n\n    if strategy not in rate_limit_factory:\n        match strategy:\n            case RateLimitType.SlidingWindow:\n                from graphrag_llm.rate_limit.sliding_window_rate_limiter import (\n                    SlidingWindowRateLimiter,\n                )\n\n                register_rate_limiter(\n                    rate_limit_type=RateLimitType.SlidingWindow,\n                    rate_limiter_initializer=SlidingWindowRateLimiter,\n                )\n\n            case _:\n                msg = f\"RateLimitConfig.type '{strategy}' is not registered in the RateLimitFactory. Registered strategies: {', '.join(rate_limit_factory.keys())}\"\n                raise ValueError(msg)\n\n    return rate_limit_factory.create(strategy=strategy, init_args=init_args)\n","sourceCodeStart":64,"sourceCodeEnd":85,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag-llm/graphrag_llm/rate_limit/rate_limit_factory.py#L64-L85","documentation":"create_rate_limiter raises this ValueError when RateLimitConfig.type does not match any strategy registered in rate_limit_factory. It is the default branch of a match statement that lazily registers the built-in limiter (SlidingWindowRateLimiter); anything else falls through. The message lists registered strategies to guide the fix.","triggerScenarios":"Calling create_completion, create_embedding, or the rate-limit test helpers (test_rpm, test_tpm, etc.) with RateLimitConfig.type set to an unregistered or misspelled value.","commonSituations":"Typos in config files, version upgrades renaming RateLimitType members, or custom rate limiter implementations not registered before use.","solutions":["Set RateLimitConfig.type to one of the strategies listed in the error message (e.g. sliding_window)","Fix typos or stale enum names in your config file/code","Register custom limiters with rate_limit_factory.register(rate_limit_type=..., rate_limiter_initializer=...) before calling the factory"],"exampleFix":"# before\nrl = RateLimitConfig(type=\"token-bucket\")\n\n# after\nrl = RateLimitConfig(type=RateLimitType.SlidingWindow)","handlingStrategy":"validation","validationCode":"from graphrag_llm.rate_limit import rate_limit_factory\n\nif rl_config.type not in rate_limit_factory:\n    raise ValueError(f\"Invalid rate limit type {rl_config.type!r}; valid: {list(rate_limit_factory.keys())}\")","typeGuard":"from graphrag_llm.rate_limit import rate_limit_factory\n\ndef is_valid_rate_limit(t: str) -> bool:\n    return t in rate_limit_factory","tryCatchPattern":"try:\n    limiter = create_rate_limiter(rl_config)\nexcept ValueError as e:\n    if \"not registered in the RateLimitFactory\" in str(e):\n        raise\n    raise","preventionTips":["Use RateLimitType enum members rather than strings in config","Validate type against factory keys during startup config checks","Pin library versions so enum member names stay stable"],"tags":["graphrag-llm","rate-limit","factory","config-validation"],"backgroundTag":"unknown-strategy-in-factory-registry","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}