sigh
This commit is contained in:
+2
-1
@@ -14,7 +14,6 @@ during chat creation to avoid massive history bloat.
|
|||||||
# ai_client.py
|
# ai_client.py
|
||||||
import anthropic
|
import anthropic
|
||||||
from google import genai
|
from google import genai
|
||||||
from google.api_core import exceptions as gac
|
|
||||||
from google.genai import types
|
from google.genai import types
|
||||||
from openai import OpenAI
|
from openai import OpenAI
|
||||||
import asyncio
|
import asyncio
|
||||||
@@ -39,6 +38,7 @@ from src import mcp_client
|
|||||||
from src import mma_prompts
|
from src import mma_prompts
|
||||||
from src import performance_monitor
|
from src import performance_monitor
|
||||||
from src import project_manager
|
from src import project_manager
|
||||||
|
from src.paths import get_credentials_path
|
||||||
from src.tool_bias import ToolBiasEngine
|
from src.tool_bias import ToolBiasEngine
|
||||||
from src.models import ToolPreset, BiasProfile, Tool
|
from src.models import ToolPreset, BiasProfile, Tool
|
||||||
from src.gemini_cli_adapter import GeminiCliAdapter
|
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:
|
def _classify_gemini_error(exc: Exception) -> ProviderError:
|
||||||
body = str(exc).lower()
|
body = str(exc).lower()
|
||||||
try:
|
try:
|
||||||
|
from google.api_core import exceptions as gac
|
||||||
if isinstance(exc, gac.ResourceExhausted):
|
if isinstance(exc, gac.ResourceExhausted):
|
||||||
return ProviderError("quota", "gemini", exc)
|
return ProviderError("quota", "gemini", exc)
|
||||||
if isinstance(exc, gac.TooManyRequests):
|
if isinstance(exc, gac.TooManyRequests):
|
||||||
|
|||||||
+1
-2
@@ -143,8 +143,7 @@ def _is_allowed(path: Path) -> bool:
|
|||||||
CRITICAL: Blacklisted files (history) are NEVER allowed.
|
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]
|
[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.paths import get_config_path, get_credentials_path
|
||||||
from src.ai_client import get_credentials_path
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
rp = path.resolve(strict=True)
|
rp = path.resolve(strict=True)
|
||||||
|
|||||||
@@ -106,6 +106,13 @@ def get_project_workspace_profiles_path(project_root: Path) -> Path:
|
|||||||
"""
|
"""
|
||||||
return project_root / ".ai" / "workspace_profiles.toml"
|
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:
|
def _resolve_path(env_var: str, config_key: str, default: str) -> Path:
|
||||||
root_dir = Path(__file__).resolve().parent.parent
|
root_dir = Path(__file__).resolve().parent.parent
|
||||||
p = None
|
p = None
|
||||||
|
|||||||
Reference in New Issue
Block a user