Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/compare_three_systems.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
str(Path.home() / "anaconda3" / "envs" / "swe_agent_py311"),
)
SWE_AGENT_RUNNER = REPO_ROOT / "swe_agent_local_runner.py"
PREFLIGHT_TIMEOUT_SECONDS = 300


@dataclass
Expand Down Expand Up @@ -315,7 +316,7 @@ def preflight_claude_endpoint(model: str) -> None:
env=_claude_environment(model),
capture_output=True,
text=True,
timeout=90,
timeout=PREFLIGHT_TIMEOUT_SECONDS,
)
if completed.returncode != 0 or not completed.stdout.strip():
detail = (completed.stderr or completed.stdout or "empty response")[-500:]
Expand All @@ -333,7 +334,7 @@ def preflight_swe_agent_environment() -> None:
cwd=REPO_ROOT,
capture_output=True,
text=True,
timeout=120,
timeout=PREFLIGHT_TIMEOUT_SECONDS,
)
if completed.returncode != 0:
detail = (completed.stderr or completed.stdout or "unknown import failure")[-1000:]
Expand Down
20 changes: 19 additions & 1 deletion tests/test_swe_agent_local_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
import pytest
import yaml

from scripts.compare_three_systems import _claude_environment, build_goal_description
from scripts.compare_three_systems import (
_claude_environment,
build_goal_description,
preflight_claude_endpoint,
)
from swe_agent_local_runner import (
LocalSWEEnv,
_install_local_environment_stubs,
Expand Down Expand Up @@ -161,6 +165,20 @@ def test_claude_environment_can_use_shared_benchmark_endpoint(monkeypatch):
assert env["ANTHROPIC_MODEL"] == "deepseek-v4-flash[1m]"


def test_claude_preflight_allows_slow_official_endpoint(monkeypatch):
observed = {}

def fake_run(*args, **kwargs):
observed.update(kwargs)
return SimpleNamespace(returncode=0, stdout="OK", stderr="")

monkeypatch.setattr("scripts.compare_three_systems.subprocess.run", fake_run)

preflight_claude_endpoint("deepseek-v4-flash")

assert observed["timeout"] == 300


def test_docker_evaluator_does_not_rewrite_official_script_by_default(monkeypatch):
monkeypatch.delenv("SWE_BENCH_PATCH_EVAL_ENV", raising=False)
evaluator = _docker_evaluator()
Expand Down
Loading