From 43a78a32936a0a7a2307648095b131be6f8c7bbf Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Sun, 18 Jan 2026 11:10:54 +0100 Subject: [PATCH 1/3] Reformatted sources --- src/app/endpoints/query.py | 1 - src/quota/quota_limiter.py | 1 - src/utils/mcp_headers.py | 1 - 3 files changed, 3 deletions(-) diff --git a/src/app/endpoints/query.py b/src/app/endpoints/query.py index 702e8927b..709998ae8 100644 --- a/src/app/endpoints/query.py +++ b/src/app/endpoints/query.py @@ -71,7 +71,6 @@ from utils.types import TurnSummary, content_to_str from authorization.azure_token_manager import AzureEntraIDManager - logger = logging.getLogger("app.endpoints.handlers") router = APIRouter(tags=["query"]) diff --git a/src/quota/quota_limiter.py b/src/quota/quota_limiter.py index f4f9d0064..79432f3b2 100644 --- a/src/quota/quota_limiter.py +++ b/src/quota/quota_limiter.py @@ -42,7 +42,6 @@ from quota.connect_pg import connect_pg from quota.connect_sqlite import connect_sqlite - logger = get_logger(__name__) diff --git a/src/utils/mcp_headers.py b/src/utils/mcp_headers.py index 46bd0d5cd..c0f8d9d51 100644 --- a/src/utils/mcp_headers.py +++ b/src/utils/mcp_headers.py @@ -8,7 +8,6 @@ from configuration import AppConfig - logger = logging.getLogger("app.endpoints.dependencies") From 7118d5884e67d2115cd5e2c0d1ff1fe89cbe8485 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Sun, 18 Jan 2026 11:11:01 +0100 Subject: [PATCH 2/3] Reformatted tests --- .../e2e/features/steps/llm_query_response.py | 1 - .../endpoints/test_rlsapi_v1_integration.py | 1 - tests/unit/app/endpoints/test_a2a.py | 1 - .../app/endpoints/test_streaming_query.py | 1 - .../unit/authentication/test_api_key_token.py | 1 - tests/unit/cache/test_postgres_cache.py | 1 - tests/unit/models/rlsapi/test_requests.py | 1 - tests/unit/models/rlsapi/test_responses.py | 1 - tests/unit/test_configuration.py | 72 +++++++------------ tests/unit/test_llama_stack_configuration.py | 1 - 10 files changed, 24 insertions(+), 57 deletions(-) diff --git a/tests/e2e/features/steps/llm_query_response.py b/tests/e2e/features/steps/llm_query_response.py index 14580aa64..732f6e291 100644 --- a/tests/e2e/features/steps/llm_query_response.py +++ b/tests/e2e/features/steps/llm_query_response.py @@ -6,7 +6,6 @@ from behave.runner import Context from tests.e2e.utils.utils import replace_placeholders - DEFAULT_LLM_TIMEOUT = 60 diff --git a/tests/integration/endpoints/test_rlsapi_v1_integration.py b/tests/integration/endpoints/test_rlsapi_v1_integration.py index a9caeec4f..6ebdb1167 100644 --- a/tests/integration/endpoints/test_rlsapi_v1_integration.py +++ b/tests/integration/endpoints/test_rlsapi_v1_integration.py @@ -32,7 +32,6 @@ from tests.unit.utils.auth_helpers import mock_authorization_resolvers from utils.suid import check_suid - # ========================================== # Shared Fixtures # ========================================== diff --git a/tests/unit/app/endpoints/test_a2a.py b/tests/unit/app/endpoints/test_a2a.py index 9a7dd67a4..a6ac3db24 100644 --- a/tests/unit/app/endpoints/test_a2a.py +++ b/tests/unit/app/endpoints/test_a2a.py @@ -39,7 +39,6 @@ from configuration import AppConfig from models.config import Action - # User ID must be proper UUID MOCK_AUTH = ( "00000001-0001-0001-0001-000000000001", diff --git a/tests/unit/app/endpoints/test_streaming_query.py b/tests/unit/app/endpoints/test_streaming_query.py index 304c43ccd..aad26903a 100644 --- a/tests/unit/app/endpoints/test_streaming_query.py +++ b/tests/unit/app/endpoints/test_streaming_query.py @@ -43,7 +43,6 @@ from tests.unit.utils.auth_helpers import mock_authorization_resolvers from utils.token_counter import TokenCounter - # Note: content_delta module doesn't exist in llama-stack-client 0.3.x # These are mock classes for backward compatibility with Agent API tests # pylint: disable=too-few-public-methods,redefined-builtin diff --git a/tests/unit/authentication/test_api_key_token.py b/tests/unit/authentication/test_api_key_token.py index 212801b48..b16be1959 100644 --- a/tests/unit/authentication/test_api_key_token.py +++ b/tests/unit/authentication/test_api_key_token.py @@ -2,7 +2,6 @@ """Unit tests for functions defined in authentication/api_key_token.py""" - import pytest from fastapi import HTTPException, Request from pydantic import SecretStr diff --git a/tests/unit/cache/test_postgres_cache.py b/tests/unit/cache/test_postgres_cache.py index b720de614..2855c9daa 100644 --- a/tests/unit/cache/test_postgres_cache.py +++ b/tests/unit/cache/test_postgres_cache.py @@ -18,7 +18,6 @@ from cache.cache_error import CacheError from cache.postgres_cache import PostgresCache - USER_ID_1 = suid.get_suid() USER_ID_2 = suid.get_suid() CONVERSATION_ID_1 = suid.get_suid() diff --git a/tests/unit/models/rlsapi/test_requests.py b/tests/unit/models/rlsapi/test_requests.py index a3218d4a9..0b72a1a53 100644 --- a/tests/unit/models/rlsapi/test_requests.py +++ b/tests/unit/models/rlsapi/test_requests.py @@ -15,7 +15,6 @@ RlsapiV1Terminal, ) - # --------------------------------------------------------------------------- # Fixtures # --------------------------------------------------------------------------- diff --git a/tests/unit/models/rlsapi/test_responses.py b/tests/unit/models/rlsapi/test_responses.py index 4fe72dc76..1de1886e9 100644 --- a/tests/unit/models/rlsapi/test_responses.py +++ b/tests/unit/models/rlsapi/test_responses.py @@ -12,7 +12,6 @@ ) from models.responses import AbstractSuccessfulResponse - # --------------------------------------------------------------------------- # Fixtures # --------------------------------------------------------------------------- diff --git a/tests/unit/test_configuration.py b/tests/unit/test_configuration.py index d231e853e..3edd3999a 100644 --- a/tests/unit/test_configuration.py +++ b/tests/unit/test_configuration.py @@ -251,8 +251,7 @@ def test_load_proper_configuration(tmpdir: Path) -> None: """Test loading proper configuration from YAML file.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: foo bar baz service: host: localhost @@ -268,8 +267,7 @@ def test_load_proper_configuration(tmpdir: Path) -> None: user_data_collection: feedback_enabled: false mcp_servers: [] - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -283,8 +281,7 @@ def test_load_configuration_with_mcp_servers(tmpdir: Path) -> None: """Test loading configuration from YAML file with MCP servers.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -305,8 +302,7 @@ def test_load_configuration_with_mcp_servers(tmpdir: Path) -> None: - name: git-server provider_id: custom-git-provider url: https://git.example.com/mcp - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -447,8 +443,7 @@ def test_load_configuration_with_customization_system_prompt_path(tmpdir: Path) cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - f""" + fout.write(f""" name: test service service: host: localhost @@ -472,8 +467,7 @@ def test_load_configuration_with_customization_system_prompt_path(tmpdir: Path) customization: disable_query_system_prompt: true system_prompt_path: {system_prompt_filename} - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -487,8 +481,7 @@ def test_load_configuration_with_customization_system_prompt(tmpdir: Path) -> No """Test loading configuration from YAML file with system_prompt in the customization.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -512,8 +505,7 @@ def test_load_configuration_with_customization_system_prompt(tmpdir: Path) -> No customization: system_prompt: |- this is system prompt in the customization section - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -532,8 +524,7 @@ def test_configuration_with_profile_customization(tmpdir: Path) -> None: expected_prompts = expected_profile.get_prompts() cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -550,8 +541,7 @@ def test_configuration_with_profile_customization(tmpdir: Path) -> None: feedback_enabled: false customization: profile_path: tests/profiles/test/profile.py - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -575,8 +565,7 @@ def test_configuration_with_all_customizations(tmpdir: Path) -> None: cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - f""" + fout.write(f""" name: test service service: host: localhost @@ -595,8 +584,7 @@ def test_configuration_with_all_customizations(tmpdir: Path) -> None: profile_path: tests/profiles/test/profile.py system_prompt: custom prompt system_prompt_path: {system_prompt_filename} - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -614,8 +602,7 @@ def test_configuration_with_sqlite_conversation_cache(tmpdir: Path) -> None: """Test loading configuration from YAML file with conversation cache configuration.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -634,8 +621,7 @@ def test_configuration_with_sqlite_conversation_cache(tmpdir: Path) -> None: type: "sqlite" sqlite: db_path: ":memory:" - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -653,8 +639,7 @@ def test_configuration_with_in_memory_conversation_cache(tmpdir: Path) -> None: """Test loading configuration from YAML file with conversation cache configuration.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -673,8 +658,7 @@ def test_configuration_with_in_memory_conversation_cache(tmpdir: Path) -> None: type: "memory" memory: max_entries: 42 - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -692,8 +676,7 @@ def test_configuration_with_quota_handlers_no_storage(tmpdir: Path) -> None: """Test loading configuration from YAML file with quota handlers configuration.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -723,8 +706,7 @@ def test_configuration_with_quota_handlers_no_storage(tmpdir: Path) -> None: scheduler: # scheduler ticks in seconds period: 1 - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -746,8 +728,7 @@ def test_configuration_with_quota_handlers(tmpdir: Path) -> None: """Test loading configuration from YAML file with quota handlers configuration.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -779,8 +760,7 @@ def test_configuration_with_quota_handlers(tmpdir: Path) -> None: scheduler: # scheduler ticks in seconds period: 1 - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -813,8 +793,7 @@ def test_load_configuration_with_azure_entra_id(tmpdir: Path) -> None: """Return Azure Entra ID configuration when provided in configuration.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -833,8 +812,7 @@ def test_load_configuration_with_azure_entra_id(tmpdir: Path) -> None: tenant_id: tenant client_id: client client_secret: secret - """ - ) + """) cfg = AppConfig() cfg.load_configuration(str(cfg_filename)) @@ -850,8 +828,7 @@ def test_load_configuration_with_incomplete_azure_entra_id_raises(tmpdir: Path) """Raise error if Azure Entra ID block is incomplete in configuration.""" cfg_filename = tmpdir / "config.yaml" with open(cfg_filename, "w", encoding="utf-8") as fout: - fout.write( - """ + fout.write(""" name: test service service: host: localhost @@ -869,8 +846,7 @@ def test_load_configuration_with_incomplete_azure_entra_id_raises(tmpdir: Path) azure_entra_id: tenant_id: tenant client_id: client - """ - ) + """) cfg = AppConfig() with pytest.raises(ValidationError): diff --git a/tests/unit/test_llama_stack_configuration.py b/tests/unit/test_llama_stack_configuration.py index 840911fa4..f6cef3a98 100644 --- a/tests/unit/test_llama_stack_configuration.py +++ b/tests/unit/test_llama_stack_configuration.py @@ -19,7 +19,6 @@ InferenceConfiguration, ) - # ============================================================================= # Test construct_vector_dbs_section # ============================================================================= From 3f080f534b381314166e1cb6aa889611cdc45234 Mon Sep 17 00:00:00 2001 From: Pavel Tisnovsky Date: Sun, 18 Jan 2026 11:13:04 +0100 Subject: [PATCH 3/3] Reformatted mock server --- dev-tools/mcp-mock-server/server.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dev-tools/mcp-mock-server/server.py b/dev-tools/mcp-mock-server/server.py index c2604e18d..b7e17fffb 100644 --- a/dev-tools/mcp-mock-server/server.py +++ b/dev-tools/mcp-mock-server/server.py @@ -25,7 +25,6 @@ from pathlib import Path from typing import Any - # Global storage for captured headers (last request) last_headers: dict[str, str] = {} request_log: list = []