{"record":{"id":"8659c37980aa6fa6","repo":"zylon-ai/private-gpt","slug":"unknown-condense-strategy-strategy","errorCode":null,"errorMessage":"Unknown condense strategy: {strategy}","messagePattern":"Unknown condense strategy: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"private_gpt/components/chat/processors/chat_history/memory/strategies/base_strategy.py","lineNumber":104,"sourceCode":") -> BaseMemoryStrategy:\n    \"\"\"Get the condense strategy from a string or CondenseStrategy enum.\n\n    Args:\n        strategy (str | CondenseStrategy): The strategy to get.\n        injector (Injector | None): Optional dependency injector for workflow builders.\n        **kwargs: Additional keyword arguments to pass to the strategy constructor.\n\n    Returns:\n        CondenseStrategy: The corresponding CondenseStrategy enum.\n    \"\"\"\n    strategy_enum = (\n        strategy\n        if isinstance(strategy, CondenseStrategyType)\n        else CondenseStrategyType.from_string(strategy)\n    )\n    provider = _PROVIDERS.get(strategy_enum)\n    if provider is None:\n        raise ValueError(f\"Unknown condense strategy: {strategy}\")\n    return provider(injector=injector, **kwargs)\n","sourceCodeStart":86,"sourceCodeEnd":106,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/chat/processors/chat_history/memory/strategies/base_strategy.py#L86-L106","documentation":"ValueError from get_condense_memory_strategy (base_strategy.py). The factory resolves the strategy string to a CondenseStrategyType enum (via from_string) or accepts an enum directly, then looks it up in _PROVIDERS; only strategies registered through register_condense_strategy exist (built-in example: \"condenser\"). An unresolvable name yields this error.","triggerScenarios":"Configuring condense strategy settings with a typo or unregistered name (e.g. \"summary\", \"rolling\", \"Condenser\"); passing a custom strategy string without first calling register_condense_strategy; version drift where a renamed strategy no longer exists.","commonSituations":"settings.yaml condense blocks copied from other projects; upgrading private-gpt and strategy names changed; custom plugins whose registration runs after settings parsing.","solutions":["Use a registered strategy name — check _PROVIDERS / the CondenseStrategyType enum for valid values (e.g. \"condenser\").","For custom strategies, call register_condense_strategy(...) with the name before get_condense_memory_strategy runs.","Fix casing/typos in the configured string; from_string matching is exact after normalization.","If a strategy disappeared after upgrade, check the changelog for its renamed replacement."],"exampleFix":"// before\nmemory:\n  condense:\n    strategy: summary   # ValueError: Unknown condense strategy\n\n// after\nmemory:\n  condense:\n    strategy: condenser","handlingStrategy":"validation","validationCode":"from private_gpt.components.chat.processors.chat_history.memory.strategies.base_strategy import _PROVIDERS\n\nif strategy_name not in {s.value for s in _PROVIDERS}:\n    raise ValueError(f\"strategy must be one of {sorted(s.value for s in _PROVIDERS)}, got {strategy_name!r}\")","typeGuard":"def is_known_strategy(name: str) -> bool:\n    from ...base_strategy import _PROVIDERS\n    from ...base_strategy import CondenseStrategyType\n    try:\n        CondenseStrategyType.from_string(name)\n        return True\n    except Exception:\n        return False","tryCatchPattern":"try:\n    strategy = get_condense_memory_strategy(name, injector)\nexcept ValueError as e:\n    raise ValueError(f\"Bad condense config: {e}. Available: condenser\") from e","preventionTips":["Validate strategy names against the enum at settings-load time.","Register custom strategies before config resolution runs.","Add a settings schema test enumerating valid strategies.","Check changelogs for renamed strategies after upgrades."],"tags":["configuration","strategy-pattern","memory","condensation"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}