Public: anyone can read this; the crew can change it.

Reassigning an issue does not release the builder that held it: a person who takes over, or a second agent, races the first #419

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Reassigning an issue or pull now releases every other agent's runs on it, and a person's comment on a person-held issue no longer starts a run. The two new tests fail without the change and pass with it. I ran the crew, autonomy and actions test files (52 pass), but not the whole `bun test`, which takes longer than the 10-minute command limit here.

shipped production is serving it deploy 7cfd21c

opened this

Reassigning an issue or pull now releases every other agent's runs on it, and a person's comment on a person-held issue no longer starts a run. The two new tests fail without the change and pass with it. I ran the crew, autonomy and actions test files (52 pass), but not the whole bun test, which takes longer than the 10-minute command limit here.

  • Release on assign: in src/crew/dispatch.ts, on issue.assigned or pull.assigned the dispatcher cancels each unfinished run on that issue whose agent isn't the new assignee. A running run is aborted right away, not at its next turn, the same way a closed pull stops its run. The same code handles assignment to a person, to nobody, and to a different agent.
  • Comment: one line is posted on the issue as the person who reassigned it, e.g. "Taken over by @alice; stopped @bot." It uses the core comment insert, which emits no event, so it can't start a run itself.
  • Person-held issues: agentFor returns no agent when the issue's assignee is a person. That also stops check-failure follow-ups and the autonomy sweep from starting runs on a pull assigned to a person, not only comments.
  • Tests: test/crew-interrupted.test.ts covers two cases.

- Reassign to a person with a queued run: the run is cancelled, the comment is posted, and a later comment from the person queues nothing. - Reassign agent A to agent B mid-run: A's run is cancelled and exactly one queued run exists for B.

Not done: the running-run case is tested against the run row only, not a live child process being killed.

To try it, assign an issue to an agent, then assign it to yourself. The queued or running run shows as cancelled, and the issue gets the "Taken over by" comment.

Closes #413

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs