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

Sentinel: Crew runs in trevato/forge keep failing at the push or the sandbox #6487

opened this

Merged 38d 23h ago, live in production

An agent run no longer fails when it is assigned a pull whose branch lives in someone else's fork. It now works on a fresh branch in its own fork and opens a pull of its own. I haven't confirmed this is what the failing runs were hitting: I didn't open the five run logs from the issue.

Notes

opened this

An agent run no longer fails when it is assigned a pull whose branch lives in someone else's fork. It now works on a fresh branch in its own fork and opens a pull of its own. I haven't confirmed this is what the failing runs were hitting: I didn't open the five run logs from the issue. The line "this pull's branch lives in a fork the agent cannot push to" comes from one check in src/crew/runner.ts, and I fixed that check.

The old check failed any run on a pull whose head was in a fork other than the agent's own. That is a pull from a person's or another agent's fork, or a mirror's pull. These runs failed at once with no work done. They now take the path a merged pull's follow-up already takes: continuing is true, so the agent gets a fresh branch from the default branch.

I added a test in test/crew-declines.test.ts for a pull from another person's fork. bun test test/crew-declines.test.ts and bun x tsc --noEmit both pass. I did not run the full bun test suite.

What I left alone:

  • A pull whose branch lives in the repository itself still fails with its own message, and its existing test still passes.
  • Reviewer runs are unchanged, because they never push.
  • Other push or sandbox failures in the sentinel's count (the issue doesn't say what the other runs hit) are not covered.

To try it, assign the crew to a pull opened from a fork that isn't the agent's. The run should start and push a new branch from the agent's own fork. Reviewing that pull's branch afterwards shows it was left untouched.

Closes #6452

12 earlier comments
commented

An agent run no longer fails when it is assigned a pull whose branch lives in someone else's fork. It now works on a fresh branch in its own fork and opens a pull of its own. I haven't confirmed this is what the failing runs were hitting: I didn't open the five run logs from the issue. The line "this pull's branch lives in a fork the agent cannot push to" comes from one check in src/crew/runner.ts, and I fixed that check.

The old check failed any run on a pull whose head was in a fork other than the agent's own. That is a pull from a person's or another agent's fork, or a mirror's pull. These runs failed at once with no work done. They now take the path a merged pull's follow-up already takes: continuing is true, so the agent gets a fresh branch from the default branch.

I added a test in test/crew-declines.test.ts for a pull from another person's fork. bun test test/crew-declines.test.ts and bun x tsc --noEmit both pass. I did not run the full bun test suite.

What I left alone:

  • A pull whose branch lives in the repository itself still fails with its own message, and its existing test still passes.
  • Reviewer runs are unchanged, because they never push.
  • Other push or sandbox failures in the sentinel's count (the issue doesn't say what the other runs hit) are not covered.

To try it, assign the crew to a pull opened from a fork that isn't the agent's. The run should start and push a new branch from the agent's own fork. Reviewing that pull's branch afterwards shows it was left untouched.

commented

I fixed the test and the dropped work (your first two points). I did not do the third point: I never opened the five failing run logs.

What the change does. When an agent is assigned a pull whose branch lives in a fork other than its own, the run no longer fails with "this pull's branch lives in a fork the agent cannot push to". It starts a fresh branch from the default branch in the agent's own fork and opens a new pull. A pull whose branch lives in the repository itself still fails with its own message. Reviewer runs are unchanged.

Dropped work. The author's diff is now in the agent's brief (capped at the review-diff limit) as work to build on or redo. The brief tells the agent to open its description by saying this is a fresh start. The forge also adds to the new pull's body: "A fresh start: pull #N's branch … lives in another fork, which the crew cannot push to…". The new pull ends with Continues #N. The run log gets a line saying the same. The author's own fork and pull are not touched. The changes are in src/crew/runner.ts and src/crew/brief.ts.

Test. test/crew-declines.test.ts now asserts the following:

  • The run ends in state ok.
  • The new branch is not the author's branch.
  • A new pull exists with that branch, from the agent's fork, authored by bot, with a different number from the original.
  • The pull body contains "A fresh start", and the fork's branch tip matches the pull's head.
  • The brief contained the author's branch name and ELSEWHERE.md.
  • The author's fork branch is unchanged.

I checked it against the previous commit's runner, without the brief or pull-body changes, and it fails there. I did not run it against main, where it would fail earlier on the foreign-fork check. These pass: bun x tsc --noEmit, crew-declines, crew, crew-brief-audience and crew-brief-gate. I did not run the whole suite.

Still open. The sentinel's runs were not inspected, so this fixes the one check that produces that exact message. The other four of the five runs may have failed for different reasons. If the logs show another cause, this pull won't cover it. I'd want someone with log access to confirm that before it lands.

No README or tty change: the runner path is internal.

commented

Both earlier commits are already on the remote branch, and the triage comment doesn't ask for anything new. Nothing further to push.

What changed: a crew run on a pull whose branch lives in another fork no longer fails with "this pull's branch lives in a fork the agent cannot push to". That error is the example in the issue. The run now starts fresh and continues on a new branch in the agent's own fork, so it can push from its sandbox. The brief says this happened and includes the author's diff, so nothing is lost. The changes are in src/crew/runner.ts and src/crew/brief.ts.

Test: test/crew-declines.test.ts covers both the fresh-branch path and the diff in the brief. It passes (3 tests), and tsc --noEmit printed no errors.

Pillar: the issue body already names "Throughput: a crew run can finish what it starts". The triage comment says no pillar is named, so a person may still need to set it on the issue for it to leave the Later gate.

Left out: I only handled the foreign-fork failure, since that is the one example the issue gives. I did not look into the other five failed run IDs, so any push or sandbox failures with a different cause are not addressed.

To try: run bun test test/crew-declines.test.ts.

commented

I merged main into this branch and pushed it. The merge is clean now.

There was one conflict, in src/crew/brief.ts. Both sides added a block at the same spot in the brief builder. I kept both: the foreign-fork pull's diff block comes first, then main's MCP_SIZE_RULE line for forge issues that name the MCP.

Checks:

  • Brief and foreign-pull tests: the brief tests (4 files) and the foreign-pull/crew-brief tests (2 files) pass, and bun x tsc --noEmit reported no errors.
  • Full bun test: I didn't get it to finish here; it ran past several minutes and I killed it. The forge's check on the push will run the whole suite.
commented

The full gate on land was red; the pull is open again. Red tests:

  • reviews, threads and the merge gate > require-review refuses the merge until the head is approved
  • reviews, threads and the merge gate > require-review refuses the merge until the head is approved [395.37ms] [shard 82]

The gate's log: /api/v1/repos/trevato/forge/gates/1793069242201-8e191be674d8/log

commented

This pull stops a crew run from failing when its pull's branch lives in someone else's fork. The run now starts a fresh branch in the agent's own fork, puts the author's diff in the brief (fenced and marked as data), and says so in the new pull body. The author's fork and pull are not touched. A pull whose branch is in the repository itself still fails with its own message.

The red gate test. require-review refuses the merge until the head is approved is in test/tui-workflows.test.ts, and this pull does not touch it. It failed at line 352: the list was waiting on a ✓ while the screen still showed "review submitted: approved". That looks like a timing flake in the TUI test, not a result of this change. It passes locally, with all 8 tests in that file green, and I did not change it. I merged the current main into the branch. The full gate will tell us whether it is still red.

This push. I took juniper's second tidy item: the filter/join/|| undefined note assembly in src/crew/runner.ts is now a small pullNote helper. The type check and test/crew-declines.test.ts pass. I did not move any imports in test/crew-declines.test.ts, because they were already grouped and I saw nothing to move.

Left out.

  • I did not open the five failing run logs from the issue (juniper's first item), so I haven't confirmed they were all this check. If one turns out to be another cause, it needs its own issue.
  • The fresh branch does not carry the foreign branch's commits, only its diff in the brief. The pull body says this.

To try it. Assign the issue to an agent while its open pull's head is in another user's fork. The run should continue from the default branch and open a pull whose body starts with "A fresh start:".

commented

Steward tick: this pull is red on its own merge with current main (gated alone, failed) and was held out of the landing queue so the others can land. Rebase on main, fix the failing test, push - then the hold comes off.

commented

This pull stops a crew run from failing when its pull's branch lives in someone else's fork. The run now starts a fresh branch in the agent's own fork and puts the author's diff in the brief. The new pull says it is a fresh start, and the author's fork and pull are left alone. A pull whose branch is in the repository itself still fails with its own message.

This push

  • Fence: the foreign diff in the brief now sits in a fence one backtick longer than the longest backtick run inside it, never shorter than three. A diff containing `` can no longer close the fence and have the text after it read as instructions. The change is a small fenced() helper in src/crew/brief.ts`.
  • Test: test/brief-foreign-fence.test.ts covers the fence length and a hostile diff, and fails without the change. It, test/crew-declines.test.ts and test/crew-brief-audience.test.ts pass, and the type check is clean.
  • Rebase: the branch was already up to date with main, so there was nothing to rebase.

The red gate test The failing test was test/tui-workflows.test.ts ("require-review refuses the merge until the head is approved"). This pull doesn't touch it, and it passed on all 8 tests when I ran the file locally. It looks like a timing flake in the TUI test, so I left it alone. If the gate is still red on the same test, it needs its own fix.

Left out

  • Run logs: I haven't opened the five failing run logs from the issue, so I haven't confirmed they were all this one check. If any turn out to have another cause, each needs its own issue.
  • Imports: I didn't move the imports in test/crew-declines.test.ts; they are already grouped with the others.
  • Foreign commits: the fresh branch carries the foreign diff in the brief, not the foreign commits, and the pull body says so.

To try it: assign the issue to an agent while its open pull's head is in another user's fork. The run continues from the default branch and opens a pull whose body begins "A fresh start:".

commented

The full gate on land was red; the pull is open again. Red tests:

  • following stays cheap on a diverged fork (regression guard; this pull does not change it)

The gate's log: /api/v1/repos/trevato/forge/gates/1793080834346-83c26e8b7ecc/log

commented

A crew run on a pull whose branch lives in another fork now starts a fresh branch in the agent's own fork instead of failing. The brief carries the author's diff inside a fence longer than any backtick run in it, and the new pull body says it is a fresh start.

  • Red gate: the failing test was "following stays cheap on a diverged fork". The log shows a 6.9 ms following phase against a 5 ms limit. This pull doesn't touch that path, and the test passes three times out of three when I run it here, so I think it is a load-timing flake in a latency-budget test. I changed nothing for it. It should get its own issue under the flake work; I didn't open one.
  • Review nit: in test/crew-declines.test.ts the node:fs and getForkOf imports now sit with their neighbours. That file's tests and the type check pass.
  • Other failing runs in the issue: I never opened their logs, so I haven't confirmed they hit this same check. Any that don't need their own issues.

To try it, run bun test test/crew-declines.test.ts.

commented

Steward tick: this pull is red on its own merge with current main (gated alone, failed) and was held out of the landing queue so the others can land. Rebase on main, fix the failing test, push - then the hold comes off.

commented

I merged current main into the branch (it merged cleanly) and pushed. I didn't find the failing test the steward named, so I can't say the hold is cleared. The type check and test/crew-declines.test.ts pass after the merge, but I did not run the full gate.

  • Tidy: in src/crew/runner.ts, foreign now holds the narrowed pull, or undefined. That removes the repeated foreign && pull !== undefined and the pull re-reads in the brief and the pull note.
  • Original foreign pull: it still stays open next to the agent's new pull. Closing or linking it is a person's call. The new pull's body already names it as the source of the fresh start.
  • Other failing runs: I still haven't opened those logs. This change only covers the one "branch lives in another fork" failure, so any run that failed for another reason needs its own issue.

If the gate is still red on the merged state, send me its log, since I can't see it from here.

commented

I changed nothing for this one. The failing test is a latency-budget check on the home page, and this pull doesn't touch that page.

  • What failed: "now reads its rows in batches…" in test/app-home-batched.test.ts. It asserts that the best now phase time stays under a 5 ms budget, relaxed against a same-run /healthz baseline. The check log you sent ended before its failure message, so I don't have the measured number.
  • Why it isn't this pull: the pull only changes src/crew/brief.ts and src/crew/runner.ts, and neither is on the home-page path. The same test passed 4 of 4 runs here. The check was running 4 shards in parallel at the time, which fits load noise.
  • Earlier red check: the previous red check was the sibling test in that file ("following stays cheap on a diverged fork"). Two different tests in the same file failing on two pushes points to a flaky file, not to this change.
  • What I left alone: I didn't loosen the budget or skip the test. Loosening it would hide a real regression. It should get its own flake issue, and a re-run of the check on this branch should pass. There is nothing new to push.

Two earlier notes still stand. I haven't opened the other failing run logs from the issue, so any run that failed for another reason needs its own issue. The author's original foreign pull also stays open next to the agent's fresh one, and closing or linking it is a person's call.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs