{"record":{"id":"7e7efb3362d08342","repo":"oraios/serena","slug":"tool-timeout-must-be-at-least-10-seconds-but-is","errorCode":null,"errorMessage":"Tool timeout must be at least 10 seconds, but is {tool_timeout} seconds","messagePattern":"Tool timeout must be at least 10 seconds, but is (.+?) seconds","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/serena/project.py","lineNumber":508,"sourceCode":"\n    def create_language_server_manager(self) -> LanguageServerManager:\n        \"\"\"\n        Creates the language server manager for the project, starting one language server per configured programming language.\n\n        :return: the language server manager, which is also stored in the project instance\n        \"\"\"\n        try:\n            # ensure that the project configuration, particularly the list of languages is complete,\n            # despite asynchronous first-time project configuration generation (which may not have completed yet)\n            self.project_config.await_asynchronous_completion()\n\n            # determine timeout to use for LS calls\n            tool_timeout = self.serena_config.tool_timeout\n            if tool_timeout is None or tool_timeout < 0:\n                ls_timeout = None\n            else:\n                if tool_timeout < 10:\n                    raise ValueError(f\"Tool timeout must be at least 10 seconds, but is {tool_timeout} seconds\")\n                ls_timeout = tool_timeout - 5  # the LS timeout is for a single call, it should be smaller than the tool timeout\n\n            # if there is an existing instance, stop its language servers first\n            if self.language_server_manager is not None:\n                log.info(\"Stopping existing language server manager ...\")\n                self.language_server_manager.stop_all()\n                self.language_server_manager = None\n\n            log.info(f\"Creating language server manager for {self.project_root}\")\n            self._language_server_manager_init_error = None\n            ls_specific_settings = dict(self.serena_config.ls_specific_settings)\n            if self.project_config.ls_specific_settings:\n                if self.is_trusted():\n                    ls_specific_settings.update(self.project_config.ls_specific_settings)\n                else:\n                    log.warning(\n                        f\"Project path {self.project_root} is not trusted, ignoring LS-specific settings from project configuration. \"\n                        \"To trust the project, modify the trusted path patterns in the global configuration.\"","sourceCodeStart":490,"sourceCodeEnd":526,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/project.py#L490-L526","documentation":"Raised by Project.create_language_server_manager (src/serena/project.py:508) when serena_config.tool_timeout is configured to a positive value below 10 seconds. The tool timeout must be at least 10s because the language-server timeout is derived as tool_timeout - 5 and single LS calls need headroom.","triggerScenarios":"Setting tool_timeout to 1–9 seconds (or 0 with a non-None config) in serena config, then starting any language-server-backed operation (indexing, get_symbols_overview, find_symbol, etc.).","commonSituations":"Users tuning timeouts too aggressively for large projects; copying example configs with small timeout values; CI environments that shrink timeouts to fail fast.","solutions":["Set tool_timeout to at least 10 in the Serena configuration (e.g. 30–60 for large projects)","Or set tool_timeout to None / a negative value to disable the timeout entirely","Restart the language server manager after changing the configuration"],"exampleFix":"// before (config)\ntool_timeout = 5\n// after\ntool_timeout = 30","handlingStrategy":"validation","validationCode":"t = cfg.tool_timeout\nif t is not None and 0 <= t < 10:\n    raise ValueError('tool_timeout must be >= 10 or negative/None to disable')","typeGuard":null,"tryCatchPattern":"try:\n    manager = project.create_language_server_manager(...)\nexcept ValueError as e:\n    logging.error('Fix tool_timeout config: %s', e)\n    raise","preventionTips":["Set tool_timeout >= 10 in config","Use 30–60s for large projects","Use None/negative to disable timeouts deliberately"],"tags":["python","configuration","timeout"],"backgroundTag":"invalid-config-value","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}