Repository navigation
Don't call a test run that stopped before its first test a failure of the change - #250
Merged
Merged
Conversation
… the change On the 0.60.0 dev slice all 34 automatic checks failed, and 28 of them told the model that the project's checks fail and to fix what its changes broke. 19 of those ran no test at all: Django's tests/ can't be discovered by unittest, and pytest stopped while collecting on modules and data that aren't there. After those notes the model spent 26 minutes, used git stash in 5 attempts, and in 2 kept editing. A run that stops before its first test now goes to the user, not the model, unless its output names a file the request changed, shell commands included. Tests that ran and failed still go to the model: over four nights those 28 notes led to no edits, so that note works as it is. Learning whether the check passes before the first change would have cost 43 more minutes on those 8 attempts, to save at most 8, and every request on a project whose checks pass would pay for it. The checks now run in the project's root rather than wherever the model's last cd left the shell, or a fine project would "not start" after a cd tests; 3 of the 34 ran from tests/. A check that hits the time limit isn't called a failure. /status, the task sheet, the review prompt and lcode -p say these checks didn't run. The notes weren't all loss: one of the 47 such attempts over four nights had stopped with a test failing, and the work the note set off fixed it. Without the note that attempt most likely fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…avira-be073c # Conflicts: # CHANGELOG.md # docs/usage.md
A real Django run printed "DJANGO_SETTIN…. It doesn't name a file": its error, which says what to set, was cut at 160 characters, and a reason ending in a full stop would have got a second one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
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.
Why
On the 0.60.0 dev slice (32K, 75 attempts), all 34 automatic checks failed, and 28 of them told the model "your changes are done, but the project's checks fail… fix what your changes broke". The question was how to stop misleading the model on projects whose checks already fail, without losing the check on small projects where it's useful. The analysis needed no model run: its numbers come from the traces, checked against the three earlier full nights. Real-model tests are under How it was tested.
What the 34 checks were
Ran N testlinebuild-cython-ext, pytest's own repository)After the "no test ran" notes the model spent 26 minutes (154 model calls), used
git stashin 5 attempts to see for itself, and in 2 attempts kept editing. One downloaded a 244 MB database and added a skip to a test file the request had excluded.Over four nights it's 48 of 103 checks with no test run, and in those 47 attempts only 3 edited anything after the note. The 28 checks where tests ran and failed led to no edits at all, and within a night every attempt at a task fails the same tests. So that note already works, and contained no regression.
What each option would have done
build-cython-ext, whose project doesn't exist until the model clones itaskmode, an approval prompt before the first editWhat changes
N passed/failed; unittest exit 1 with a traceback and noRan N test). You get the reason and what to run. If the output names a file the request changed, shell commands included, it still goes to the model: that's what the check is for.cdleft the shell. 3 of the 34 ran fromtests/. Without this a fine project would "not start" after acd tests. A command from your owncheckssetting runs in the folder you started lcode in./status, the task sheet, the review prompt andlcode -psay "didn't run" for these instead of "failed (exit code 1)", also for no tests or no test runner. Traces keep the real exit code.Notes for tests that ran and failed are unchanged, and so is the system prompt.
The cost, plainly
Removing the notes can lose a pass now and then.
build-cython-ext__x9ttQdihad stopped with1 failed, 17 passedon a test it called pre-existing, and the verifier needs that test to pass. The misleading note got it going again, and among the out-of-scope work it fixed that test. Without the note, that attempt most likely scores 0. That's 1 attempt in 47, on 1 night in 4.django-14792__yvwDw7Walso ran its new test only because of the note and fixed it, with no effect on its reward.Expect about 26 minutes less per night, and now and then one attempt fewer. The gate can't resolve a difference that small.
How it was tested
Real model (
qwen3.6-35bat 32K) on this branch merged with main, which includes 0.61.0 and #252.Harbor, one attempt each, on tasks where a run stops before its first test. All three reached the check. In each, the "stopped before running a test" message appeared, no note reached the model, and the request ended with the model's answer, with no model call after the check.
django__django-12774ImproperlyConfigured(unittest, noRan N tests)PASS_TO_PASStests failpytest-dev__pytest-10051No module named 'xmlschema'(pytest exit 2)test_clear_for_call_stage; this task failed 4 of 5 attempts on the last three runsbuild-cython-extCould not find a knots database file(pytest exit 2)KeyError: 'pos'itself, with no noteSpeed limited this test, so it says nothing about scores or time; that's for the gate. The machine was short of RAM in the daytime.
build-cython-extneeds about 10 minutes at healthy speed, so the attempt above ran at 43 tokens/s with its limit doubled (harbor run --agent-timeout-multiplier 2). Four more attempts didn't reach a check and say nothing about this change: one lost its reply stream whenlcode updaterestarted Ollama, two ran out ofbuild-cython-ext's 15 minutes at 14 and 46 tokens/s, and the repeat guard stopped one that kept runningruntests.pyfrom the wrong folder.A real terminal with the real model, on three small projects in
askmode:cd testsfirst: with the status bar ontests/,.venv/bin/python -m pytest -qandpython3 -m unittest discover -s testsran from the root and passed, and the shell stayed intests/. Neither command starts from insidetests/.calc.py, anda - b, where unittest reportsFAILED (failures=2). The model fixed both, and the checks then passed./statussaiddidn't run. A rename in that same project still reached the model, because the error namescalc.py.These tests found one bug in this PR, now fixed: the message cut Django's error at 160 characters (
DJANGO_SETTIN….), and a reason ending in a full stop got a second one (download_database()..). It now keeps 240 characters and one full stop.Also:
FakeOllamaandmake_agent, using real pytest and unittest runs. A syntax error, a new missing import, a removed name, a broken new test, a brokenconftest.py, the same edit by shell command, andrmof a module all still reach the model.cd tests, and breakingdjango/conf/__init__.pygets a note.This changes what the model is told, so it still goes through a gate night.
Left out on purpose
cd. That's an existing bug, not made worse.Found while testing, not changed here
chat_streamturns connection errors intoOllamaErroronly when opening the request, soChunkedEncodingErrorends bothlcodeandlcode -pin a traceback. Restarting Ollama during a reply is enough..venv/bin/python -m pytest -q tests/test_calc.pypassing made/statussaypassedon the stuck project, and lcode skipped its own run (coversonly looks for the check's text). That's 1 of 137 recorded attempts and 1 of the 4 terminal sessions, always after the model had seen the exact command.🤖 Generated with Claude Code