From c8ccc5a44fdbff8198cff361bda451d6e3660cc0 Mon Sep 17 00:00:00 2001 From: xprilion Date: Mon, 27 Apr 2026 14:48:17 +0530 Subject: [PATCH 1/2] fix qodana python version --- .gitignore | 2 ++ backend/openmlr/services/session_manager.py | 6 +++--- backend/openmlr/tools/compute_tools.py | 4 +++- backend/tests/test_agent_loop.py | 2 -- qodana.yaml | 1 + 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index ada3f1a..8d4291a 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ Thumbs.db *.swo *~ +.qodana-reports/ + # Environment .env .env.local diff --git a/backend/openmlr/services/session_manager.py b/backend/openmlr/services/session_manager.py index d59d7b1..4a26da1 100644 --- a/backend/openmlr/services/session_manager.py +++ b/backend/openmlr/services/session_manager.py @@ -86,11 +86,11 @@ async def get_or_create_session( session = Session(config=config, conversation_id=conversation_id) - # Determine effective compute node - effective_node = None + ops = None if user_id and db: try: - from ..db import operations as ops + from openmlr.db import operations as ops_module + ops = ops_module.operations # Check conversation override conv = await ops.get_conversation_by_id(db, conversation_id) if conv and conv.extra: diff --git a/backend/openmlr/tools/compute_tools.py b/backend/openmlr/tools/compute_tools.py index 2d6c0c9..fa9ca9f 100644 --- a/backend/openmlr/tools/compute_tools.py +++ b/backend/openmlr/tools/compute_tools.py @@ -69,6 +69,7 @@ async def _handle_probe(node_name: str, user_id: int = None, db=None, **kwargs): try: wm = WorkspaceManager() + sm: SandboxManager | None = None sm = SandboxManager(workspace_manager=wm) await sm.create(node.type, node.config) sandbox = sm.get_active() @@ -115,7 +116,8 @@ async def _handle_probe(node_name: str, user_id: int = None, db=None, **kwargs): except Exception as e: try: - await sm.destroy() + if sm is not None: + await sm.destroy() except Exception: pass await ops.update_compute_node( diff --git a/backend/tests/test_agent_loop.py b/backend/tests/test_agent_loop.py index dab8179..a430bf3 100644 --- a/backend/tests/test_agent_loop.py +++ b/backend/tests/test_agent_loop.py @@ -343,8 +343,6 @@ async def test_cancelled_returns_none(self, mock_session): async def mock_stream(messages, config, tools): yield "Hello" - if False: - yield with patch("openmlr.agent.loop.LLMProvider.generate_stream") as mock_str: mock_str.return_value = mock_stream(None, None, None) diff --git a/qodana.yaml b/qodana.yaml index 9a4826a..4964fbe 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -6,5 +6,6 @@ version: "1.0" linter: jetbrains/qodana-python-community:2025.3 profile: name: qodana.recommended + python-version: "3.12" include: - name: CheckDependencyLicenses From 1bbd0d7c6caac412b8289e98e96d31309f438d38 Mon Sep 17 00:00:00 2001 From: xprilion Date: Mon, 27 Apr 2026 14:51:34 +0530 Subject: [PATCH 2/2] fix qodana python version --- qodana.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qodana.yaml b/qodana.yaml index 4964fbe..b04a6de 100644 --- a/qodana.yaml +++ b/qodana.yaml @@ -6,6 +6,7 @@ version: "1.0" linter: jetbrains/qodana-python-community:2025.3 profile: name: qodana.recommended - python-version: "3.12" include: - name: CheckDependencyLicenses +exclude: + - name: PyTypeHintsInspection