diff --git a/src/serena/constants.py b/src/serena/constants.py index 8b9a4dde..6a277598 100644 --- a/src/serena/constants.py +++ b/src/serena/constants.py @@ -23,4 +23,4 @@ USE_SOLID_LSP = True """Whether to use Solid LSP instead of multilspy for language server operations. Multilspy uses asyncio, which creates many problems like deadlocks and requires full process isolation (and even then some issues remain). -""" \ No newline at end of file +""" diff --git a/src/serena/mcp.py b/src/serena/mcp.py index 28150bab..e2a0bc95 100644 --- a/src/serena/mcp.py +++ b/src/serena/mcp.py @@ -188,10 +188,11 @@ class SerenaMCPFactory: mcp = FastMCP(**mcp_settings.model_dump()) return mcp - @asynccontextmanager # type: ignore + @asynccontextmanager @abstractmethod async def server_lifespan(self, mcp_server: FastMCP) -> AsyncIterator[None]: """Manage server startup and shutdown lifecycle.""" + yield None # ensures MyPy understands we yield None class SerenaMCPFactorySingleProcess(SerenaMCPFactory): diff --git a/src/serena/process_isolated_agent.py b/src/serena/process_isolated_agent.py index 081dcc65..90699b03 100644 --- a/src/serena/process_isolated_agent.py +++ b/src/serena/process_isolated_agent.py @@ -414,10 +414,10 @@ class ProcessIsolatedSerenaAgent: # Create communication pipe parent_conn, child_conn = multiprocessing.Pipe() - self.conn = parent_conn # type: ignore + self.conn = parent_conn # Create and start worker process, passing along the dashboard's queue if available - worker = SerenaAgentWorker(child_conn) # type: ignore + worker = SerenaAgentWorker(child_conn) self.process = multiprocessing.Process(target=worker.run, args=[_global_log_queue]) self.process.start() diff --git a/src/serena/util/shell.py b/src/serena/util/shell.py index 05080e0e..c899b212 100644 --- a/src/serena/util/shell.py +++ b/src/serena/util/shell.py @@ -31,7 +31,7 @@ def execute_shell_command(command: str, cwd: str | None = None, capture_stderr: stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE if capture_stderr else None, - creationflags=subprocess.CREATE_NO_WINDOW if is_windows else 0, + creationflags=subprocess.CREATE_NO_WINDOW if is_windows else 0, # type: ignore text=True, encoding="utf-8", errors="replace", @@ -50,7 +50,7 @@ def subprocess_check_output(args: list[str], encoding: str = "utf-8", strip: boo "env": os.environ.copy(), } if platform.system() == "Windows": - kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW + kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW # type: ignore output = subprocess.check_output(args, **kwargs).decode(encoding) # type: ignore if strip: output = output.strip()