MCPcopy Create free account
hub / github.com/agentforce314/clawcodex / _server_env

Function _server_env

eval/run_compare.py:503–524  ·  view source on GitHub ↗
(
    *,
    swebench_repo: Path,
    clawcodex_repo: Path,
    openclaude_repo: Path,
    agent: str,
)

Source from the content-addressed store, hash-verified

501
502
503def _server_env(
504 *,
505 swebench_repo: Path,
506 clawcodex_repo: Path,
507 openclaude_repo: Path,
508 agent: str,
509) -> dict[str, str]:
510 env = os.environ.copy()
511 # Make `scripts.*` imports resolve from inside the SWE-bench repo.
512 pythonpath = [str(swebench_repo)]
513 if env.get("PYTHONPATH"):
514 pythonpath.append(env["PYTHONPATH"])
515 env["PYTHONPATH"] = os.pathsep.join(pythonpath)
516
517 # Repo locations the wrappers themselves consult.
518 if clawcodex_repo.is_dir():
519 env.setdefault("CLAWCODEX_REPO", str(clawcodex_repo))
520 # Only point at a source checkout when it is actually built; otherwise the
521 # API server should fall through to global `openclaude` on PATH (npm -g).
522 if openclaude_repo.is_dir() and (openclaude_repo / "dist" / "cli.mjs").is_file():
523 env.setdefault("OPENCLAUDE_REPO", str(openclaude_repo))
524 return env
525
526
527def _run_predictions(

Callers 1

cmd_runFunction · 0.85

Calls 3

joinMethod · 0.80
getMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected