fix(worker): hard-stop reject-artifact patch failures (§60)#445
Merged
Conversation
SaJaToGu
pushed a commit
that referenced
this pull request
Jun 25, 2026
- open.md: §60 stubbed out as DONE-via-PR-#445 (squash 2549f0f). Cross-references §57 (also done) and the still-valid general principle for any future returncode class. Old §60 body (Measured/Suggested scope/Checks) trimmed from open.md. - done.md: full §60 closure entry with bug description, repro (PR #444 / Issue #390 / gpt-4o / returncode 5 / reject artifacts), fix locations (workers/base.py + workers/execution.py + workers/openrouter_worker.py + scripts/solve_issues.py), scope discipline (NO refactor of nonzero_with_changes, per User directive), verification matrix (22+96+53+168 OK + GitHub CI green + user live review 'mergebereit'), and the general principle that §57 (returncode 6) and §60 (returncode 5) both implement. Backlog is now: §59 watchlist (parked, Mode-C Threshold ≥3) + §59-related notes only. §60 closed. All §51-§58 done via earlier PRs.
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.
Closes §60 (docs/BACKLOG/open.md).
Bug
workers/execution.pyclassify_worker_outcomeonly hardenedagainst
PARTIAL_PATCH_FAILURE_RETURN_CODE = 6(PR #442 / §57).It did not generalize to "any nonzero worker-returncode that
produces partial on-disk changes must be a hard stop".
returncode = 5(reject artifacts inOpenRouterWorker, i.e..orig/.rejfiles left in the working tree after a partialgit apply) still fell through to the genericnonzero_with_changesbranch with
failure_class: success. The run then proceeded tocommit + push + open a PR with whatever changes had been partially
applied.
Repro (PR #444)
Issue #390 validation run, 2026-06-26, gpt-4o via
openrouter_direct:worker_exit_code: 5(Reject-Artefakte)run_outcome_worker_status: failedrun_outcome_has_changes: Truerun_outcome_failure_class: success(lie classification)run_outcome_delivery_status: pr_createdprovider_scorecard_test_result: not_run(timeout 300s)PR #444 was closed + branch
ai/fix-issue-390deleted. Samesymptom as PR #441 / §57, just one returncode class later.
Fix
workers/base.py: new shared constantPATCH_VALIDATION_FAILED_RETURN_CODE = 5. Reasonpatch_validation_faileddocumented in the outcome taxonomy.workers/execution.pyclassify_worker_outcome: newbranch between
partial_patch_failureandchanged—returncode == PATCH_VALIDATION_FAILED_RETURN_CODE→WorkerOutcome(False, has_changes, "patch_validation_failed").Returns before the generic
nonzero_with_changesbranch.workers/openrouter_worker.py: uses the shared constantinstead of the magic
5literal. Doc-string for thereturncode semantics updated.
scripts/solve_issues.py: doc-string forrun_openrouter_direct_workerreturncode semantics updated.Scope
User-specified scope — targeted fix, no refactor:
If other nonzero returncodes (e.g. 3 for timeout) need the same
treatment, that is a separate item (potential §60b).
Acceptance test
User-specified reproduction:
Covered by
tests/test_worker_execution.py(+1 new test) andtests/test_worker_adapters.py(+1 new test).Verification
./.venv/bin/python -m unittest tests.test_worker_execution -v: 22 OK (was 21, +1)./.venv/bin/python -m unittest tests.test_worker_adapters -v: 96 OK (was 95, +1)./.venv/bin/python -m unittest tests.test_openrouter_worker -v: 53 OK./.venv/bin/python -m unittest tests.test_solve_issues -v: 168 OK (no regression)git diff --check develop..HEAD: cleanDiff: 6 files, +39/-5.