DockerEnvironment that also accepts a plain command string. mini-swe-agent v2's `execute` takes an action dict (`{"command": ...}`), but CodeClash's arena code calls `execute("some shell command")` directly. Normalize so both work.
| 21 | for var in _SECRET_ENV_VARS: |
| 22 | val = os.getenv(var) |
| 23 | if val and val in text: |
| 24 | text = text.replace(val, f"<REDACTED_{var}>") |
| 25 | return text |
| 26 | |
| 27 | |
| 28 | def _scratch_dir() -> str | None: |
| 29 | """Local scratch dir for staging `docker cp` transfers. Defaults to the system temp dir. |
| 30 | Override with CODECLASH_TMPDIR (e.g. on AWS Batch, where the default temp dir misbehaves).""" |
| 31 | override = os.getenv("CODECLASH_TMPDIR") |
| 32 | if override: |
| 33 | Path(override).mkdir(parents=True, exist_ok=True) |
| 34 | return override |
| 35 | |
| 36 |