You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e67307b
Browse filesBrowse the repository at this point in the historyBrowse files
authored
π [v6] contribute: never dispatch rework for a merged or closed PR (#17403)
* π [v6] contribute: never dispatch rework for a merged or closed PR
#17385 merged at 13:13:58Z; at ~14:25Z the hub still
handed Danathar's relay "fix-pr hive#17385", and the relay ran it twice.
Hub:
- Queue a nudged PR under owner/name, not the nudge's Display (the bare
configured name on a hive that lists repos without the org). Resolve
keys on owner/name, so the bare entry was never removed when the PR
left stage 072, and the relay could not match the task's repo "hive"
to an owner/name.
- Before dispatching a queued fix, check its PR is still open (state
cache first, else one PR read tagged hive:contribute_fix_dispatch).
Merged or closed PRs leave the queue with a log line; an unreadable
state holds the dispatch for this tick. fixqueue.Next previews what a
dispatch would take so only those PRs are checked.
- Send a boundary fix task once: the ready handler ships the returned
message, so sendFixTask no longer pushes it as well.
- Progress for an in-flight fix task (a boundary fix runs as the relay's
primary task) is not a resume claim and is no longer revoked.
Relay:
- A fix-pr task_id the relay already runs (primary, parallel, preempting
or deferred) is ignored on a second task_assign, with a log line naming
where it runs; a fix that becomes the primary task says so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
* test(contribute): a retried boundary fix's progress is not revoked (utah-packages#972)
projectbluefin/utah-packages#972, 2026-11-09: the relay refused
fix-karibhou-1, the hub requeued it and served it at the next ready as
fix-karibhou-2 on the same connection, and the relay's progress for the
retry (repo empty, client_gen 1870) was answered with "no matching
server-issued lease" and task_revoke at 14:50:21Z and 14:54:36Z.
The handleTaskProgress change in this PR already covers it; this test
drives the real fail -> requeue -> boundary dispatch path and sends
progress without a repo, as the relay did, so the retried task id must be
tracked on the connection and never revoked.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
* contribute: an unreadable PR state no longer keeps the relay idle
When a queued fix's PR state could not be read, selectFixTask answered
task_unavailable/fix_pr_in_flight, so the relay got no new issue either.
That happens when GitHub is struggling or the API budget is low, the time
the hive needs its contributors most. The fix now stays queued and is
retried on the next ready, and the relay takes ordinary work meanwhile.
Busy fix slots still answer task_unavailable as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Douglas Baggett <doug.baggett@gmail.com>
---------
Signed-off-by: Danathar <Danathar@users.noreply.github.com>
Signed-off-by: Douglas Baggett <doug.baggett@gmail.com>
Co-authored-by: Danathar <Danathar@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
- A contributor's relay is no longer sent to rework a PR that has already merged or closed, and one `fix-pr` task now runs once. On hivecommons/hive#17385 a stage-072 nudge queued a fix at 12:32Z, the PR merged at 13:13:58Z, and at about 14:25Z the hub still handed the relay `fix-pr hive#17385`, which the relay then ran twice: about 4.5 minutes lost, nothing pushed. Each link in that chain is fixed. The fix queue took the nudge's display name (`hive` on a hive whose repos are listed without the org), so the "left stage 072" resolve, which looks up `owner/name`, never found the entry, and the relay got a repo it could not match to its authorized list; queued fixes are now keyed and sent as `owner/name`. Right before a queued fix is handed out, the hub now checks the PR is still open (from the state cache when it holds the repo, else one PR read tagged `hive:contribute_fix_dispatch`); a merged or closed PR leaves the queue with a `fix queue: dropped a PR that is no longer open` log line, and if the state cannot be read the fix waits for the next tick while the relay takes ordinary work. A fix handed out at a task boundary was pushed to the relay twice (once by the dispatcher, once by the `ready` handler); it is now sent once, and the relay ignores a second `task_assign` for a `fix-pr` task it is already running (as its primary task, in a parallel session, preempting, or deferred) and logs where it runs. Progress reports from a boundary fix running as the relay's primary task are no longer answered with `task_revoke: no active lease for this task`, which killed the fix mid-run.
Copy file name to clipboardExpand all lines: src/docs/contributor-relay.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1757,9 +1757,12 @@ Set `HIVE_MAX_PARALLEL_FIXES=0` in `~/.config/hive/contributor.env` and restart
1757
1757
- `mode=preempt`, interactive pane: `task_accepted`, then the pane receives an `INTERRUPT (hive fix-pr, preempt mode)` prompt telling the agent to park the current issue (commit/stash WIP; the claim stays alive), fix the PR, print exactly `HIVE_FIX_PR_DONE <task_id>` (or `HIVE_FIX_PR_FAILED <task_id> <reason>`), then resume. The progress tick reads the marker off the pane and reports `task_complete`/`task_failed` for the fix's `task_id`. Only one fix preempts at a time; more are queued locally.
1758
1758
- `mode=preempt`, headless primary: there is no pane to interrupt, so the fix is deferred (`task_accepted` immediately) and runs before the relay's next `ready` β "fix what you broke before taking new work" holds on the client too.
1759
1759
- With no task running, a `fix-pr` is just the next task.
1760
+
- One `fix-pr` task runs in one place. A second `task_assign` with a `task_id` the relay is already running β as its primary task, in a parallel session, as the preempting fix, or deferred β is ignored, and the log says where it is already running.
1760
1761
1761
1762
The hub records the mode it used in the nudge comment's marker (`mode=spawn|preempt|queued|comment`) and exposes queue depth / in-flight as `fix_queue` on the contributor profile API.
1762
1763
1764
+
**Only open PRs are dispatched.** Right before a queued fix is handed out, the hub checks that its PR is still open: from the state cache when it holds the repo (free while the cached copy is inside its freshness bound, otherwise one re-read), else with one PR read tagged `hive:contribute_fix_dispatch`. A PR that has merged or closed leaves the queue with a `fix queue: dropped a PR that is no longer open` log line, and no relay is sent to rework it. When the state cannot be read, the fix is not dispatched that tick: it stays queued and the next one asks again, and a relay asking for its next task gets ordinary work meanwhile instead of waiting idle. Queued fixes carry the repo as `owner/name` even on a hive that lists its repos without the org, so the fix task's `repo` and the PR leaving stage 072 both match the queued entry.
1765
+
1763
1766
**When the relay fails the task.** `task_failed` for a fix's `task_id` does not settle it as done: its PRs go back in the hub's queue (same place by age) and are not interrupted back in for 5 minutes, though the relay's next `ready` serves them at once. After three failed dispatches a PR leaves the fix queue and the stage engine's re-nudge / adoption path takes over. A dispatch the relay fails within one second of the nudge is not reported as delivered: the nudge comment reads `mode=queued`, says the relay could not take the task (quoting the relay's `message`/`reason`), and the stage log carries `relay_failed=true` (hivecommons/hive#14668).
1764
1767
1765
1768
#### What the operator sees (Operations β Connected contributor agents)
0 commit comments