Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
Python agent-evaluationaiai-alignmentai-evaluationai-governanceai-safetyclidiagnostic-tooleu-ai-acthallucination-detectioniso-42001llm-evaluationllm-securitynist-ai-rmfowasp-llmprompt-injectionpythonresponsible-airisk-assessmentrisk-management
fix: launch setup runs through the current Python interpreter (#265)
Rudy Mizrahi Celeklice5a1d0d0257
diff --git a/ifixai/cli/setup_cmd.py b/ifixai/cli/setup_cmd.pyindex e403231..d30b9a3 100644--- a/ifixai/cli/setup_cmd.py+++ b/ifixai/cli/setup_cmd.py@@ -468,7 +468,7 @@ def setup(ctx: click.Context) -> None:click.echo()if ui.confirm("Run iFixAi now?", default=not missing):- cmd = [sys.argv[0], "run"]+ cmd = [sys.executable, "-m", "ifixai.cli.main", "run"]if provider == "mock":cmd += ["-k", "unused"]if missing:diff --git a/ifixai/tests/test_setup_module_run_launcher.py b/ifixai/tests/test_setup_module_run_launcher.pynew file mode 100644index 0000000..ca30c59--- /dev/null+++ b/ifixai/tests/test_setup_module_run_launcher.py@@ -0,0 +1,35 @@+import os+import subprocess+import sys+from pathlib import Path++from click.testing import CliRunner++from ifixai.cli import setup_cmd+from ifixai.cli.setup_cmd import setup+++def test_setup_can_launch_a_run_from_python_module_entrypoint(monkeypatch):+ runner = CliRunner()+ main_path = str(Path(setup_cmd.__file__).with_name('main.py'))+ root = str(Path(setup_cmd.__file__).parents[2])+ monkeypatch.setenv('PYTHONPATH', os.pathsep.join([root, os.environ.get('PYTHONPATH', '')]))+ monkeypatch.setattr(sys, 'argv', [main_path, 'setup'])+ monkeypatch.setattr(setup_cmd.ui, 'is_interactive', lambda: True)+ monkeypatch.setattr(setup_cmd.ui, 'select', lambda message, choices, **kwargs: 'mock' if 'mock' in choices else choices[0])+ monkeypatch.setattr(setup_cmd.ui, 'text', lambda *args, **kwargs: '')+ monkeypatch.setattr(setup_cmd.ui, 'confirm', lambda *args, **kwargs: True)+ run = subprocess.run+ children = []++ def launch(command):+ child = run([*command, '--test', 'B01', '--dry-run', '--no-telemetry', '--no-promo'], capture_output=True, text=True)+ children.append(child)+ return child++ monkeypatch.setattr(setup_cmd.subprocess, 'run', launch)+ with runner.isolated_filesystem():+ result = runner.invoke(setup)+ assert result.exit_code == 0, result.exception+ assert len(children) == 1+ assert children[0].returncode == 0, children[0].stdout + children[0].stderr