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

Open the pull at the agent's first push, not when the run ends #1220

Closed opened this
Closed without merging

The forge now opens an agent's pull at its first push, and the preview follows each later push. I couldn't run the new crew tests here, so they have not been run. The sandbox refuses the unix-socket listen that test/crew.test.ts needs (EPERM).

Notes

stopped closed without shipping

opened this

The forge now opens an agent's pull at its first push, and the preview follows each later push. I couldn't run the new crew tests here, so they have not been run. The sandbox refuses the unix-socket listen that test/crew.test.ts needs (EPERM). The suite's setup fails the same way on main, so it isn't caused by this change. The type check printed no errors.

What changed

  • Early open: a new module, src/crew/early.ts, opens the pull while the run is still active. It does this once the agent's branch has at least one commit beyond the base, using the same title, base and head landWork would have used. The body says the work is in progress and links the run's log.
  • No second pull: when the run ends, landWork in src/crew/runner.ts finds that pull and replaces the placeholder with the agent's report and the Closes #N trailer. It does not open another.
  • Abandoned work: a run that ends DECLINED, or with nothing beyond the base, closes any early pull with a comment saying why.
  • No loop on failed checks: src/crew/dispatch.ts no longer queues a check_failed follow-up for a pull while its authoring run is still active. The CHECK_FAILED_LIMIT budget is left untouched.
  • Brief and docs: src/crew/brief.ts tells the agent to push a first working commit early and keep pushing. It also says the pull and its preview appear on that first push. Golden path step 2 in docs/APPS.md says the same.
  • Tests: test/crew.test.ts covers these cases:
    • a mid-run push has an open pull and a preview deploy before the run finishes, and exactly one pull afterwards;
    • a failed deploy of a work-in-progress push queues no follow-up while the run is active, and leaves the budget alone.

What I left out

  • I did not change deploy superseding. A push every few seconds relies on the existing behaviour, and I did not check that it holds.
  • I did not add a separate in-progress marker beyond the placeholder body, so I did not check how the pull reads in the Needs you list.

How to try it: give an agent a task that needs several commits. The pull should appear after its first push, and the preview should redeploy on each later push. When the run ends, the same pull's body becomes the agent's report.

Closes #1049

2 earlier comments
commented

scout only (reviewers: not for you): the check on this pull is red and the decider says the change caused it. Read the failing tests in the check log, fix them on this branch and push, or say in one line why the red is not yours.

commented

The red check was my change, and I've pushed a fix. I couldn't run test/crew.test.ts here, so the fix is untested. The sandbox refuses the unix-socket listen the suite needs (EPERM). The type check passes.

What was wrong: when a run ends, landWork in src/crew/runner.ts finds the pull opened at the first push. It reported that as updated pull #N. The existing crew tests expect the run that creates a pull to report opened pull #N. That is the summary prefix asserted in the three tests the check log names (assignment, merged-before-run, provider-limit resume). The log lists five failures but names only three; I didn't see the other two. I read the three named tests and expect the other two to be the same assertion, but I haven't checked.

The fix: when landWork replaces an early pull's placeholder with the report, the run summary now says opened pull #N. When the pull already had its real body, for example on a feedback run, it still says updated pull #N. The updated assertions in test/crew.test.ts and test/crew-remotes.test.ts are untouched.

What I left out: I changed no tests, since the old expectations were right. The two items under "What I left out" in the original description still stand: deploy superseding on rapid pushes, and how an in-progress pull reads in the Needs you list.

To check: the forge's check on this push is the real run of test/crew.test.ts.

commented

Parked by the crew: the check failed ("the crew, with a stand-in Claude Code > the pull opens at the first push, in progress, and the run's end fills it in") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs