Skip to content

fix: prevent release lock cycles and agent tool crashes - #870

Merged
RetroGameDeveloper merged 2 commits into
mainfrom
fix/release-lock-order
Nov 8, 2026
Merged

RetroGameDeveloper merged 2 commits into
mainfrom
fix/release-lock-order

Conversation

@RetroGameDeveloper

@RetroGameDeveloper RetroGameDeveloper commented Nov 8, 2026 •

Copy link
Copy Markdown

Fixes

  • Plain release tools acquire the per-agent/function candidate lock before retaining the project publication lock. Compiles publish using the same order. This removes a reproducible lock cycle while keeping receipt generation checks and note-publication markers guarded. Both API and MCP use the corrected entry path; waiting is included in candidate lock timings.
  • Empty control-flow bodies return no store-reuse initialization evidence instead of indexing a missing entry node.
  • Candidate-quality review explains when a historical alternative has no source, instead of slicing NULL or implying a fresh verdict.
  • Deep Search honors an explicit log.parallel_claims=False from bounded background CPU handoffs. Its normal default remains enabled. A regression verifies an existing agent lease is untouched.

Evidence and limits

Recent local tool transcripts contain a release taking 299 s and another taking 113 s despite almost no reported project-lock or synchronization wait. Inspection found release tool entry retaining the project lock before its receipt acquires the candidate lock, reversing compile publication order. A bounded synthetic reproduction through both actual transports makes the compile unable to acquire its project lock on the old implementation; both finish in the correct order with this fix. This establishes the cycle, not that it explains every observed delay.

Three unexpected MCP tool exceptions in the reviewed logs identify the missing-source and empty-flow crashes above. Broader verification also exposed the ignored CPU handoff claim policy; it is corrected rather than excluded.

Long cross-project verification-lane waits remain unresolved. The newer phase fields now show some waits concentrated in verification admission, rather than the compiler or SQL. This PR does not increase timeouts, skip imports, weaken matching or claim all long waits are solved.

Verification

  • 340 tests passed in three fresh-process groups: 104 + 167 + 69. Coverage includes API/MCP release ordering, receipt replay/claim tokens, notes saved during rechecks, foreground reads, progress/judging, repair generation/quality, deep throughput and nonexclusive permuter behavior.
  • Five new regressions fail against the prior implementation (both transport lock cycles, two empty-body forms, missing alternative source); the semicolon-only control already passed.
  • Full Ruff (src tests projects) and git diff --check pass.
  • An initial MCP test harness identified the wrong thread before AnyIO dispatch; corrected to observe the actual lock waiter. A later combined run was killed with signal 137 without a diagnostic; the same complete coverage passed in the three groups above, without exclusions.
  • Synthetic fixtures and the homemade demo only. No paid agent experiments, live-project mutations or runtime update/restart. No UI changes or screenshots needed.

After #869 merged, rebased onto b10d1bce; retained both performance-document sections. All four changed implementation files are byte-identical to their tested pre-rebase versions. 129 integration tests passed on the combined tree, including new m2c session/autopilot pipeline coverage; full Ruff and diff checks passed again.

The release entry also rechecks function identity after acquiring both locks: a function replaced while queued must not make the handler acquire a different candidate lock under the retained project lock. The new rejection regression and 218 targeted tests passed (45.22 s) on the final guard change; full Ruff/diff checks passed again. Claim/source state is not changed by this rejection.

Remote CI status at merge inspection: Linux and Windows full-suite jobs are running; macOS and label jobs remain queued. No remote failures are reported, and the main branch has no required remote checks (gh pr checks --required reports none; branch protection API reports unprotected). The local regression/lint checks above are complete. Hosted CI remains pending and is not represented as passed; its eventual result must be followed up.

@RetroGameDeveloper
RetroGameDeveloper merged commit a8fb98b into main Nov 8, 2026
0 of 8 checks passed
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.

1 participant