From 607aeaf2d21980eef1e8e345395de4bea110e01c Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sat, 16 May 2026 04:10:33 -0400 Subject: [PATCH] sigh --- src/ai_client.py | 3 ++- src/mcp_client.py | 3 +-- src/paths.py | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ai_client.py b/src/ai_client.py index addc58bb..b7c188bc 100644 --- a/src/ai_client.py +++ b/src/ai_client.py @@ -14,7 +14,6 @@ during chat creation to avoid massive history bloat. # ai_client.py import anthropic from google import genai -from google.api_core import exceptions as gac from google.genai import types from openai import OpenAI import asyncio @@ -39,6 +38,7 @@ from src import mcp_client from src import mma_prompts from src import performance_monitor from src import project_manager +from src.paths import get_credentials_path from src.tool_bias import ToolBiasEngine from src.models import ToolPreset, BiasProfile, Tool from src.gemini_cli_adapter import GeminiCliAdapter @@ -360,6 +360,7 @@ def _classify_anthropic_error(exc: Exception) -> ProviderError: def _classify_gemini_error(exc: Exception) -> ProviderError: body = str(exc).lower() try: + from google.api_core import exceptions as gac if isinstance(exc, gac.ResourceExhausted): return ProviderError("quota", "gemini", exc) if isinstance(exc, gac.TooManyRequests): diff --git a/src/mcp_client.py b/src/mcp_client.py index 5f46f307..84b7bd9c 100644 --- a/src/mcp_client.py +++ b/src/mcp_client.py @@ -143,8 +143,7 @@ def _is_allowed(path: Path) -> bool: CRITICAL: Blacklisted files (history) are NEVER allowed. [C: tests/test_arch_boundary_phase1.py:TestArchBoundaryPhase1.test_mcp_client_whitelist_enforcement, tests/test_history_management.py:test_mcp_blacklist] """ - from src.paths import get_config_path - from src.ai_client import get_credentials_path + from src.paths import get_config_path, get_credentials_path try: rp = path.resolve(strict=True) diff --git a/src/paths.py b/src/paths.py index bec4c414..78c20ac0 100644 --- a/src/paths.py +++ b/src/paths.py @@ -106,6 +106,13 @@ def get_project_workspace_profiles_path(project_root: Path) -> Path: """ return project_root / ".ai" / "workspace_profiles.toml" +def get_credentials_path() -> Path: + """ + [C: src/mcp_client.py:_is_allowed] + """ + root_dir = Path(__file__).resolve().parent.parent + return Path(os.environ.get("SLOP_CREDENTIALS", str(root_dir / "credentials.toml"))) + def _resolve_path(env_var: str, config_key: str, default: str) -> Path: root_dir = Path(__file__).resolve().parent.parent p = None