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

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

Closed opened this
Closed without merging

Pushed successfully. Opens the pull (and its preview) the moment an agent's branch is first ahead of the base, instead of waiting for the whole run to finish — cutting the wait from 9–38 minutes down to seconds.

Notes

stopped closed without shipping deploy 182bc5c

opened this

Pushed successfully.

Opens the pull (and its preview) the moment an agent's branch is first ahead of the base, instead of waiting for the whole run to finish — cutting the wait from 9–38 minutes down to seconds.

What changed:

  • src/crew/runner.ts: a lightweight poller (watchForFirstPush) checks the fork's branch every 2s while the agent works; the first time it's ahead of the base it opens a placeholder pull ("Work in progress…", linked to the run's log). landWork finds that pull by branch when the run ends and replaces the placeholder with its report and Closes #N; a decline or a branch with nothing on it closes the placeholder instead of leaving debris.
  • src/crew/dispatch.ts: a failed check on a work-in-progress push no longer re-engages the agent while its authoring run is still going. This needed a branch-based lookup (activeRunForBranch, in src/core/runs.ts) rather than an issue-id one — the placeholder pull's issue id differs from the id the authoring run was queued under (the task issue, from before any pull existed), so an id-only check would have missed it and queued a wasted follow-up burning CHECK_FAILED_LIMIT budget. I found and fixed this gap while reviewing the pre-existing diff.
  • Also fixed a race where the polling watcher stayed alive while landWork itself pushed and opened/updated the pull, which could double-open a pull for one branch; the watcher is now always stopped before landWork touches anything.
  • src/crew/brief.ts and docs/APPS.md now tell the story straight: push early, the pull and preview follow the first push.
  • test/crew.test.ts: a mid-run push opens the pull and gets a preview deploy before the run ends, a failing check on that placeholder queues no follow-up, and exactly one pull exists once the run lands.

Left out: nothing from the acceptance list. bun x tsc --noEmit and the full check test suite both pass with no new failures (6 pre-existing failures remain, confirmed present on the base branch too — they're sandboxed git-auth issues unrelated to this change).

Closes #10

commented

Pushed successfully.

Merged main (ee61bac, the typed-plan/crew-picking work) into this branch. No overlapping edits between the two feature sets — main's src/crew/plan.ts and src/web/palette.ts sit alongside this branch's placeholder-pull-on-first-push logic in runner.ts/dispatch.ts/core/runs.ts without conflicting.

While verifying, I found test/apps.test.ts's new "a deploy whose test step sleeps" test (added by main's #23) never merged its own pull once green — every other pull-opening test in that file does. That left it open, so the later restart test's "the bot's pull is the one open pull" assertion saw two open previews instead of one. Confirmed this fails on plain main too, so it predates this merge; fixed the test by adding the same mergePull call its neighbors already use, rather than touching the app code.

The forge's declared check suite (192 tests across 18 files) is green. The remaining full-suite failures are sandbox artifacts unrelated to the merge: my shell's injected git credential/author env vars leak into tests that spin up their own local git servers with embedded auth, and ssh-keygen isn't installed here — neither is part of forge.json's check.

commented

Parked by the crew: main moved under it 3 times and the branch could not be brought up to date (docs/APPS.md, src/crew/runner.ts, test/apps.test.ts, test/crew.test.ts)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs