{"record":{"id":"e45453e180d86ad5","repo":"oraios/serena","slug":"activation-command-timeout-must-be-positive-got","errorCode":null,"errorMessage":"activation_command_timeout must be positive, got: {activation_command_timeout}","messagePattern":"activation_command_timeout must be positive, got: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/serena/config/serena_config.py","lineNumber":604,"sourceCode":"            try:\n                ls_str = ls_str.lower()\n                if ls_str in lang_name_mapping:\n                    ls_str = lang_name_mapping[ls_str]\n                ls_id = LanguageServerId(ls_str)\n                ls_ids.append(ls_id)\n            except ValueError as e:\n                raise ValueError(\n                    f\"Invalid language server: '{orig_language_str}'.\\nValid values are: {[l.value for l in LanguageServerId]}\"\n                ) from e\n\n        # Validate activation_command_timeout\n        activation_command_timeout_raw = data.get(\"activation_command_timeout\", 180.0)\n        try:\n            activation_command_timeout = float(activation_command_timeout_raw)\n        except (TypeError, ValueError) as e:\n            raise ValueError(f\"activation_command_timeout must be a number, got: {activation_command_timeout_raw}\") from e\n        if activation_command_timeout <= 0:\n            raise ValueError(f\"activation_command_timeout must be positive, got: {activation_command_timeout}\")\n\n        # Validate symbol_info_budget\n        symbol_info_budget_raw = data[\"symbol_info_budget\"]\n        symbol_info_budget = symbol_info_budget_raw\n        if symbol_info_budget is not None:\n            try:\n                symbol_info_budget = float(symbol_info_budget_raw)\n            except (TypeError, ValueError) as e:\n                raise ValueError(f\"symbol_info_budget must be a number or null, got: {symbol_info_budget_raw}\") from e\n            if symbol_info_budget < 0:\n                raise ValueError(f\"symbol_info_budget cannot be negative, got: {symbol_info_budget}\")\n\n        language_backend_value = data.get(\"language_backend\")\n        language_backend = LanguageBackend.from_str(language_backend_value) if language_backend_value else None\n\n        line_ending_value = data.get(\"line_ending\")\n        line_ending = LineEnding.from_str(line_ending_value) if line_ending_value else None\n","sourceCodeStart":586,"sourceCodeEnd":622,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/config/serena_config.py#L586-L622","documentation":"After successfully parsing activation_command_timeout to a float, _from_dict enforces that it is strictly greater than zero; a zero or negative value raises ValueError. A non-positive timeout would make the language-server activation wait immediately expire, so the library rejects it at config-load time.","triggerScenarios":"ProjectConfig.autogenerate(..., activation_command_timeout=0) or a negative value like -1; a project.yml containing activation_command_timeout: 0 or 0.0; passing float('0') parsed from an env var with a stale/default value.","commonSituations":"Setting the timeout to 0 to try to 'disable waiting' (unsupported); copying a template with a 0 placeholder and forgetting to fill it in; computing the timeout via a formula that evaluated to 0 (e.g. seconds * missing multiplier).","solutions":["Set the timeout to a positive number of seconds, e.g. activation_command_timeout: 180 (the default) or higher for slow language servers","If you wanted to skip the activation command, remove the command/timeout rather than zeroing the timeout","Validate inputs before calling autogenerate: assert float(v) > 0"],"exampleFix":"// before (project.yml)\nactivation_command_timeout: 0\n// after (project.yml)\nactivation_command_timeout: 180.0","handlingStrategy":"validation","validationCode":"timeout = float(data.get(\"activation_command_timeout\", 180.0))\nif timeout <= 0:\n    raise ValueError(f\"activation_command_timeout must be > 0, got {timeout}\")","typeGuard":"def is_positive_number(v) -> bool:\n    return isinstance(v, (int, float)) and not isinstance(v, bool) and v > 0","tryCatchPattern":"try:\n    config = ProjectConfig.load(project_root)\nexcept ValueError as e:\n    if 'activation_command_timeout must be positive' in str(e):\n        logger.warning(\"Resetting activation_command_timeout to default 180.0\")\n        # patch the yml or proceed with defaults\n    raise","preventionTips":["Never use 0 to 'disable' the timeout — remove the activation command instead","Fill in placeholder values (0, -1) left in config templates","Compute timeouts from multipliers carefully; assert result > 0","Use 180 (the default) or higher for slow language servers like large TS projects"],"tags":["python","configuration","validation","range-check"],"backgroundTag":"schema-validation-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}