open-swe/agent
Johannes du Plessis 1d4f1aed33
fix: reviewer publishes against stale head_sha on mid-run re-review (#1393)
* fix: resolve reviewer head_sha from thread metadata, not frozen run config

A push that lands while a reviewer run is in flight is delivered as a
queued message into that run. The run's configurable is frozen at
creation, so its head_sha still names the commit the run was created for
— not the commit just pushed. publish_review then anchored the GitHub
review to the stale commit and regressed last_reviewed_sha to it, and
add_finding/update_finding stamped findings with the stale SHA.

Persist the current head in thread metadata at every reviewer dispatch
(both the ready-for-review and push paths, before they branch to create
a run or queue a message), and add resolve_review_head_sha() which
prefers the metadata head over the run config. Wire it into
publish_review (review commit_id + last_reviewed_sha), add_finding
(first_seen_sha) and update_finding (last_confirmed_sha). Falls back to
the run config when metadata carries no head (first review, eval, tests).

* fix: persist head_sha in manual review dispatch (trigger_pr_review_from_ref)

resolve_review_head_sha prefers metadata[head_sha] over the run config,
and the push/ready dispatchers write it — but trigger_pr_review_from_ref
(Slack/GitHub @open-swe review, request_pr_review tool) created a run
with a freshly-fetched config head while leaving metadata's head stale
from a prior dispatch. A manual re-review at a newer commit would then
resolve to the old head and publish/advance findings against it.

Persist head_sha in that dispatch's metadata write too, so every
run-creating reviewer dispatch keeps metadata in sync with the head its
run targets. Caught by the Open SWE reviewer on this PR.
2026-06-03 11:38:56 -07:00
..
dashboard fix: reliable, safe Slack account-connect prompt + first-login Slack dialog (#1383) 2026-06-02 20:55:07 -07:00
integrations feat: add idle TTL and delete-after-stop sandbox lifecycle controls (#1265) 2026-05-08 00:30:14 -04:00
middleware fix: sanitize malformed Anthropic thinking blocks (#1357) 2026-05-28 16:15:13 -07:00
skills feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
tools fix: reviewer publishes against stale head_sha on mid-run re-review (#1393) 2026-06-03 11:38:56 -07:00
utils chore: attribute commit co-author to open-swe[bot], not open-swe user 2026-06-03 11:19:24 -07:00
analyzer.py feat: outcomes dataset + bootstrap/continual split via skills (#1365) 2026-06-01 13:25:12 -07:00
encryption.py feat: support TOKEN_ENCRYPTION_KEY rotation via MultiFernet [closes AB-2323] (#1275) 2026-05-08 14:29:23 -07:00
prompt.py chore: attribute commit co-author to open-swe[bot], not open-swe user 2026-06-03 11:19:24 -07:00
review_style_collector.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
review_style_guidance.py feat: tune reviewer for precision — web/wiki tools + recalibrated prompt (#1312) 2026-05-20 18:35:00 +00:00
reviewer.py fix: scope public reviewer tokens (#1389) 2026-06-03 09:25:17 -07:00
reviewer_diff.py feat: Inject PR title and body into reviewer context (#1368) 2026-06-01 21:06:19 +00:00
reviewer_findings.py fix: reviewer publishes against stale head_sha on mid-run re-review (#1393) 2026-06-03 11:38:56 -07:00
reviewer_publish.py fix: dedup empty reviewer summary by PR state, not stale re_review flag (#1391) 2026-06-03 10:30:13 -07:00
reviewer_reconcile.py feat: let reviewer set comment titles (#1356) 2026-05-28 16:04:38 -07:00
server.py chore: attribute commit co-author to open-swe[bot], not open-swe user 2026-06-03 11:19:24 -07:00
webapp.py fix: reviewer publishes against stale head_sha on mid-run re-review (#1393) 2026-06-03 11:38:56 -07:00