{"record":{"id":"83124fc36e820d8b","repo":"oraios/serena","slug":"activation-command-timeout-must-be-a-number-got","errorCode":null,"errorMessage":"activation_command_timeout must be a number, got: {activation_command_timeout_raw}","messagePattern":"activation_command_timeout must be a number, got: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/serena/config/serena_config.py","lineNumber":602,"sourceCode":"        for ls_str in data[\"language_servers\"]:\n            orig_language_str = ls_str\n            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\")","sourceCodeStart":584,"sourceCodeEnd":620,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/config/serena_config.py#L584-L620","documentation":"_from_dict validates the project config's activation_command_timeout by casting it with float(). If the raw value is None or a non-numeric string (TypeError/ValueError), it raises ValueError stating the value must be a number. This timeout governs how long Serena waits for the language server activation command, so it must be numeric.","triggerScenarios":"ProjectConfig.autogenerate(..., activation_command_timeout=None) or load() on a project.yml where activation_command_timeout is null, a string like 'five minutes' or '180s', or any non-numeric YAML scalar. Default is 180.0 when the key is absent.","commonSituations":"Hand-editing project.yml and writing activation_command_timeout: '300s' or leaving `activation_command_timeout:` with no value (YAML null); passing a string from an environment variable into autogenerate without conversion; pasting config where the unit was embedded in the value.","solutions":["Set activation_command_timeout to a bare number in seconds, e.g. activation_command_timeout: 300","If loading from env/CLI, convert explicitly: float(os.environ[\"ACTIVATION_TIMEOUT\"]) before passing it","Remove the key entirely to use the 180.0 default","Also ensure the value is > 0, otherwise the follow-up 'must be positive' error fires"],"exampleFix":"// before (project.yml)\nactivation_command_timeout: \"300s\"\n// after (project.yml)\nactivation_command_timeout: 300.0","handlingStrategy":"type-guard","validationCode":"raw = data.get(\"activation_command_timeout\", 180.0)\nif raw is None or not isinstance(raw, (int, float)):\n    raise TypeError(f\"activation_command_timeout must be a number, got {raw!r}\")","typeGuard":"def is_number(v) -> bool:\n    return isinstance(v, (int, float)) and not isinstance(v, bool)","tryCatchPattern":"try:\n    config = ProjectConfig.load(project_root)\nexcept ValueError as e:\n    if 'activation_command_timeout must be a number' in str(e):\n        cfg = yaml.safe_load(project_yml)\n        cfg['activation_command_timeout'] = 180.0\n        # rewrite or fall back to defaults\n    raise","preventionTips":["Never write units into the YAML value ('300s') — use plain seconds","Avoid leaving `activation_command_timeout:` empty (YAML null); delete the key to use the 180.0 default","Convert env-var/CLI string inputs with float() before passing to autogenerate","Quote-check YAML: unquoted '180.0' is fine, but trailing comments must be separated by space"],"tags":["python","configuration","validation","type-error"],"backgroundTag":"schema-validation-failed","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}