DRAFT: swtbench: tighten default prompt to discourage non-test edits (option 1 of #708)#710
Draft
juanmichelini wants to merge 1 commit into
Draft
DRAFT: swtbench: tighten default prompt to discourage non-test edits (option 1 of #708)#710juanmichelini wants to merge 1 commit into
juanmichelini wants to merge 1 commit into
Conversation
The default prompt asked the agent to 'DON'T have to modify the actual logic' but in the same breath instructed it to 'Create a script reproduction.py' and 'Edit the sourcecode of the repo to integrate your reproduction script into the test framework'. Those last two steps are at odds with the real scoring rule (only diffs against existing test files count) and they explain a lot of the bad behavior seen on qwen3-coder-next: 78% of patches end up touching source code or scratch files, dropping the solve rate from 45.5% (test-only) to 1.2% (mixed). This rewrites the prompt to: - spell out exactly which paths are scored and why touching source files silences the F2P signal; - ban scratch files at the repo root (reproduction.py, FIX_SUMMARY.md, root-level test_*.py) and ban build/, docs/, pyproject.toml etc.; - replace the 'create reproduction.py + edit sourcecode' steps with 'run throwaway code via BashTool' + 'edit only existing test files inside the test directory'; - add a final 'git diff --name-only and revert anything outside the test directory' step. Edits the default template directly so the change applies to every SWT-bench run (including the SDK run-eval workflow, which does not thread --prompt-path through). See #708. Co-authored-by: openhands <openhands@all-hands.dev>
ab5127f to
6e1dfbd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses option 1 from #708.
What
Tightens the existing SWT-bench prompt at
benchmarks/swtbench/prompts/default.j2so the agent stops modifying source code and scratch files alongside its tests.The previous default prompt was self-contradictory:
reproduction.py" and step 3 said "Edit the sourcecode of the repo to integrate your reproduction script into the test framework".That's a lot of the failure mode on qwen3-coder-next (#708 found 78% of patches touch source or scratch files; the test-only subset solves at 45.5%, mixed at 1.2%).
This PR edits
default.j2to:IMPORTANTblock stating exactly which paths are scored and why touching source files silences the F2P signal;reproduction.py,test_repro.py,FIX_SUMMARY.md), andbuild/,docs/,pyproject.toml, etc.;create reproduction.py) with "use BashTool to confirm the buggy behavior";edit sourcecode) with "edit only existing test files inside the test directory";git diff --name-onlyand revert anything outside the test directory.Diff is 13 added / 4 removed lines, no new files.
Scope
benchmarks/swtbench/prompts/default.j2.--prompt-pathexplicitly — including the SDKrun-eval.yml, which doesn't thread--prompt-paththrough, so the change activates automatically once merged.How to test
Re-run any SWT-bench config — no extra flags needed. Compare the resulting
output.swtbench.jsonlpatch-shape distribution to the baseline run linked in #708: the "mixed test + source" share should drop substantially. Score lift only materializes if the agent actually follows the instructions; if it doesn't, #711 (post-processing strip) is the safety net.Risks / caveats
Refs #708. Supersedes the earlier version of this PR that added a separate
qwen3_coder_next.j2template.This PR was created by an AI agent (OpenHands) on behalf of @juanmichelini.