Skip to content

swe_env/anyswe: fix #1572 server-suite CI + address @ffrujeri review - #1796

Merged
adil-a merged 1 commit into
NVIDIA-NeMo:cmunley1/anyswefrom
adil-a:swe-env-readme
Jun 27, 2026
Merged

adil-a merged 1 commit into
NVIDIA-NeMo:cmunley1/anyswefrom
adil-a:swe-env-readme

Conversation

@adil-a

@adil-a adil-a commented Jun 27, 2026 •

Copy link
Copy Markdown
Contributor

Unblocks #1572's server-suite CI and addresses @ffrujeri's review on #1572. Targets cmunley1/anyswe.

CI unblock

  • swe_env was missing a README.md → ng_test_all (with fail_on_total_and_test_mismatch) failed the total-vs-tested module assertion on every shard. Adding the README makes the counts match and runs swe_env's unit tests in CI.

Review-comment fixes (@ffrujeri)

# Comment Fix
1 truncation mask never fires inner agents (hermes/claude_code) now emit top-level status="incomplete" on internal max-turns/context/timeout; anyswe masks resolved AND incomplete (verified the status round-trips through response.json). openclaw exposes no internal signal → documented.
2 openclaw config not runnable select the apptainer provider for its .sif formatter; drop dead apptainer_memory_limit_mb/skip_eval fields.
3 docker timeout gaps configurable default exec timeout + bounded close/cp so a hung in-container command can't block a rollout.
4 reward-profiling evidence gold-patch baseline in the swe_env README (see below).
5 _setup_params assumes str instance_dict accept str or dict (mirror _build_swetask).
6 r2egym docstring missing eval_script is unmasked reward-0, not an eval-error mask.
7 missing docker binary wrap FileNotFoundError → clear SandboxCreateError.
8 unquoted shell interpolation shlex.quote dataset values in bash -c (nv_internal/harness/swe_bench_ext).
9 rc 125/126/127 infra-classify narrow to rc 125 only (126/127 are legit user-command codes).
10 swe_rebench inflates on empty-required empty-required guard (consistent with compute_resolved).
11 unmasked infra failure on docker grade mask SandboxCreateError/image-pull (error_kind="sandbox").
12 per-framework parsers untested add test_parsing_frameworks.py (the 7 reviewer cases).
13 docs discoverability add a fern SWE-Environment page.

Gold-patch baseline (review #4) — and a fidelity fix it surfaced

A full 500-instance SWE-bench Verified gold-patch census on docker resolves 486/500 (patch_exists 500/500, 0 infra errors), in line with the apptainer/.sif nested reference 492/500; empty patch 0/500.

The census caught a real docker-flat grading bug: swebench 4.1.0's eval command for some families (sphinx via tox, several sklearn) runs pytest without -rA, so passing tests print only as dots and the host-side parser (parse_log_pytest_v2) saw zero passes → ~45 instances unresolved even for the gold patch (445/500). Fixed by forcing PYTEST_ADDOPTS=-rA in the flat eval (445→486). The remaining ~14 are instance-specific (documented astropy/django flaky gold-failures + a few single-test-not-run cases).

Validation

  • swe_env + docker-provider + anyswe + claude_code/openclaw unit tests pass; ruff clean; fern check clean.
  • The #1 truncation logic was adversarially verified end-to-end (status survives the container→host round-trip; the mask is live).

Notes

  • DCO on the base squash-merge commit (5b40359c) is a separate sign-off, tracked by the repo owner.

🤖 Generated with Claude Code

The CI server-suite asserts every candidate module dir (resources_servers/*,
responses_api_agents/*, responses_api_models/*) has a README.md and is therefore
in the tested set (fail_on_total_and_test_mismatch). The new swe_env library dir
had no README, so it counted as a candidate but not a tested module -> the
total-vs-tested mismatch assertion failed on every shard. Adding the README makes
the counts match and runs swe_env's unit tests (FakeProvider-backed, no Docker) in
CI. swe_env is a library: data validation is skipped (non-resources_servers path).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Codex <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Jun 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@adil-a
adil-a merged commit 5ef4a37 into NVIDIA-NeMo:cmunley1/anyswe Jun 27, 2026
10 checks passed
@adil-a adil-a changed the title swe_env: add README so ng_test_all treats it as a tested module swe_env/anyswe: fix #1572 server-suite CI + address @ffrujeri review Jun 28, 2026
adil-a added a commit that referenced this pull request Jun 29, 2026
…ine) (#1802)

Addresses @ffrujeri's review on #1572 (all 13 inline comments) plus the
reward-profiling baseline. Targets `cmunley1/anyswe`.

> Note: the swe_env `README.md` / `ng_test_all` CI-unblock landed
separately via #1796 (merged). This PR is the review-comment fixes +
docs + gold baseline on top of that.

## Review-comment fixes (@ffrujeri)
| # | Comment | Fix |
|---|---|---|
| 1 | truncation mask never fires | inner agents (hermes/claude_code)
now emit top-level `status="incomplete"` on internal
max-turns/context/timeout; anyswe masks `resolved AND incomplete`
(verified the status round-trips through `response.json`). openclaw
exposes no internal signal → documented. |
| 2 | openclaw config not runnable | select the apptainer provider for
its `.sif` formatter; drop dead `apptainer_memory_limit_mb`/`skip_eval`
fields. |
| 3 | docker timeout gaps | configurable default `exec` timeout +
bounded `close`/`cp` so a hung in-container command can't block a
rollout. |
| 4 | reward-profiling evidence | gold-patch baseline in the swe_env
README (below). |
| 5 | `_setup_params` assumes str `instance_dict` | accept str **or**
dict (mirror `_build_swetask`). |
| 6 | r2egym docstring | missing `eval_script` is unmasked reward-0, not
an eval-error mask. |
| 7 | missing docker binary | wrap `FileNotFoundError` → clear
`SandboxCreateError`. |
| 8 | unquoted shell interpolation | `shlex.quote` dataset values in
`bash -c` (nv_internal/harness/swe_bench_ext). |
| 9 | rc 125/126/127 infra-classify | narrow to **rc 125** only (126/127
are legit user-command codes). |
| 10 | swe_rebench inflates on empty-required | empty-required guard
(consistent with `compute_resolved`). |
| 11 | unmasked infra failure on docker grade | mask
`SandboxCreateError`/image-pull (`error_kind="sandbox"`). |
| 12 | per-framework parsers untested | add `test_parsing_frameworks.py`
(the 7 reviewer cases). |
| 13 | docs discoverability | add a fern SWE-Environment page. |

## Gold-patch baseline (review #4) — at parity with the nested reference
A full 500-instance SWE-bench Verified **gold-patch census on docker**
resolves **493/500** (`patch_exists` 500/500, 0 infra errors), matching
the apptainer/`.sif` *nested* reference **492/500** to within
environment noise; empty patch **0/500**. (docker and apptainer both use
the host-side flat grader here, so they're 1-1; the `.sif` figure is
swebench's nested `run_evaluation`.)

The census surfaced + fixed two real flat↔nested **reconstruction** gaps
(445 → 486 → 493), verified with **0 regressions**:
- **`PYTEST_ADDOPTS=-rA`**: swebench 4.1.0's eval for some families
(sphinx via `tox`, several sklearn) runs pytest without `-rA`, so
passing tests print only as dots and the host-side parser saw zero
passes → ~45 unresolved even for gold (445→486).
- **drop `GIT_CONFIG_GLOBAL=/dev/null`**: older images' git can't parse
`/dev/null`, so the eval's `git checkout` + test-patch `git apply`
failed → required tests "absent" (486→493).

The remaining 7 misses are a small symmetric difference with `.sif` (4
shared genuine env-flaky: astropy-7606/8707/8872, django-10097; 3
docker-only sphinx instance-specific quirks; docker also resolves 4 that
`.sif` misses).

## Validation
- 258 unit tests pass (swe_env + docker provider + anyswe +
claude_code/openclaw); ruff clean; `fern check` clean.
- The `#1` truncation logic was adversarially verified end-to-end
(top-level `status` survives the container→host round-trip; the mask is
live).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Codex <[email protected]>
Co-authored-by: Codex <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants