Skip to content

SWE servers: an agent can stall patch capture so that its rollout is masked, not graded #6732

Backlog

Description

@yfw

Describe the bug

The SWE resources servers capture the model's patch by running git in the agent's sandbox, after the agent ends. The agent controls that sandbox and its git setup. So an agent can make the capture hang until its 300 s deadline. A capture that fails with a provider error type (such as "timeout") is masked as an infrastructure failure, so the rollout is not graded. A model can then learn to hide a failing rollout from the loss and from eval denominators, where a graded empty patch would give it 0.

Where this applies on main today (cdf2a680f2):

Steps/Code to reproduce bug

In a task sandbox, as the agent:

echo '* diff=stall' >> .gitattributes
git config diff.stall.textconv 'sleep 100000'

Then end the episode and let the server verify it. The capture's git diff runs the text conversion, hits the 300 s deadline with error_type="timeout", and the row comes back masked, with no grading. Other ways to stall the capture: a core.fsmonitor hook, a post-index-change or other index hook, an external diff driver (diff.external or diff.<driver>.command), a clean or process filter from .gitattributes, a very large untracked tree, or a replaced git binary or PATH.

Expected behavior

A capture failure that the agent caused is graded: the empty patch, or a completed 0 with a failure_reason. Only a confirmed infrastructure failure (the provider lost the sandbox, or the exec never answered) is masked.

Proposed plan

  1. Harden the shared capture (small PR, all ten servers). Run the capture's git commands with -c core.fsmonitor= -c core.hooksPath=/dev/null, and its diffs with --no-textconv --no-ext-diff. Text conversion and external diff output is not a patch that applies anyway. Clean and process filters stay on, because they decide the patch content. Add real-git tests: a hanging fsmonitor hook, index hook, textconv driver and external diff driver no longer stop the capture.
  2. Tell an agent stall from a sick sandbox. After a capture timeout, run one trivial command (such as true) in the same sandbox with a short deadline. If it answers, the sandbox is alive, so the stall came from the repository the agent left: grade it as an agent failure, unmasked. If it does not answer, mask the row as infrastructure. Without this check, scoring every capture timeout 0 would also train a 0 when the sandbox was only overloaded.
  3. Apply that rule in all ten servers, on both the episode path and the cookie path. Add a real-git regression test for each kind: a hanging agent-installed driver must give an unmasked row, and a lost provider must still mask.

Step 1 cannot close every way in, because the agent controls the whole sandbox (it can replace git). Step 2 is the real fix.

Additional context

A draft of step 1 exists, with real-git tests for both the episode and the Agent /run paths. It was kept out of #6670 to keep that PR focused.

🤖 Generated with Claude Code

Activity

  1. added
    bug
    area:environment
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Environment & Benchmarksarea:environmentbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions