A merged PR at the agent's HEAD also closes the run Done (#1395)

Co-authored-by: catomean <catomean@users.noreply.github.com>
This commit is contained in:
Catoandcatomean authored and GitHub committed 2026-10-21 23:39:49 +00:00
1 parent ea21c03415
commit 2c18d1f4de
4 files changed
+17 -3

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "fleet-runner",
"version": "0.8.57",
"version": "0.8.58",
"description": "Fleet Runner — the Loki desktop agent runtime: owns the agent terminals on this computer for projects set to run here.",
"main": "./out/main/index.js",
"author": {
+2 -1
View File
@@ -15,7 +15,8 @@ const ok = {
assert.equal(shippedPr(ok), url);
assert.equal(shippedPr({ ...ok, dirty: true }), null, "uncommitted work: not done");
assert.equal(shippedPr({ ...ok, headSha: "abc1234" }), null, "unpushed commits: not done");
assert.equal(shippedPr({ ...ok, pr: { ...ok.pr, state: "MERGED" } }), null);
assert.equal(shippedPr({ ...ok, pr: { ...ok.pr, state: "MERGED" } }), url, "auto-merged already");
assert.equal(shippedPr({ ...ok, pr: { ...ok.pr, state: "CLOSED" } }), null);
assert.equal(shippedPr({ ...ok, pr: null }), null);
assert.equal(shippedPr({ ...ok, branch: "main" }), null);
assert.equal(shippedPr({ ...ok, pr: { ...ok.pr, url: "https://evil.example/pull/1" } }), null);
+10
View File
@@ -28,6 +28,16 @@ export interface ReleaseEntry {
/** Newest first. */
export const FLEET_RUNNER_RELEASES: ReleaseEntry[] = [
{
version: "0.8.58",
tag: "fleet-runner-v0.8.58",
date: "2026-10-21T23:35:00Z",
highlights: [
"A run whose pull request was already merged automatically also closes as Done with that link once the agent goes quiet.",
],
breaking: [],
notes: "",
},
{
version: "0.8.57",
tag: "fleet-runner-v0.8.57",
+4 -1
View File
@@ -41,6 +41,9 @@ export function shippedPr(s: {
pr: { url: string; state: string; headRefOid: string } | null;
}): string | null {
if (s.dirty || !s.branch || s.branch === s.defaultBranch || !s.pr) return null;
if (s.pr.state !== "OPEN" || !s.headSha || s.pr.headRefOid !== s.headSha) return null;
// MERGED counts too: auto-merge usually lands the PR within minutes, before
// the agent has been quiet long enough (Substrata #193/#194, 2026-10-22).
if (s.pr.state !== "OPEN" && s.pr.state !== "MERGED") return null;
if (!s.headSha || s.pr.headRefOid !== s.headSha) return null;
return /^https:\/\/github\.com\/[\w.-]+\/[\w.-]+\/pull\/\d+$/.test(s.pr.url) ? s.pr.url : null;
}