patchrelay 0.47.0 → 0.47.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "service": "patchrelay",
3
- "version": "0.47.0",
4
- "commit": "fbb6eb06a47a",
5
- "builtAt": "2026-04-18T09:56:26.471Z"
3
+ "version": "0.47.1",
4
+ "commit": "919d86a4ee45",
5
+ "builtAt": "2026-04-18T12:45:08.672Z"
6
6
  }
@@ -1,5 +1,6 @@
1
1
  import { deriveGateCheckStatusFromRollup } from "../github-rollup.js";
2
2
  import { ACTIVE_RUN_STATES } from "../factory-state.js";
3
+ import { isUndelegatedPausedNoPrWork } from "../paused-issue-state.js";
3
4
  import { hasOpenPr, resolveClosedPrDisposition } from "../pr-state.js";
4
5
  const RECONCILIATION_GRACE_MS = 120_000;
5
6
  const DOWNSTREAM_STALE_MS = 900_000;
@@ -166,6 +167,7 @@ export async function collectClusterHealth(config, db, runCommand) {
166
167
  }
167
168
  function evaluateLocalIssueHealth(snapshot) {
168
169
  const { issue, session, missingTrackedBlockers, blockedBy, ageMs, readyForExecution } = snapshot;
170
+ const pausedNoPrWork = isUndelegatedPausedNoPrWork(issue);
169
171
  if (issue.factoryState === "failed" || issue.factoryState === "escalated") {
170
172
  return {
171
173
  status: "fail",
@@ -204,14 +206,14 @@ function evaluateLocalIssueHealth(snapshot) {
204
206
  message: "Issue is ready for execution but no active run has started",
205
207
  };
206
208
  }
207
- if (ACTIVE_RUN_STATES.has(issue.factoryState) && issue.activeRunId === undefined && ageMs >= RECONCILIATION_GRACE_MS) {
209
+ if (!pausedNoPrWork && ACTIVE_RUN_STATES.has(issue.factoryState) && issue.activeRunId === undefined && ageMs >= RECONCILIATION_GRACE_MS) {
208
210
  return {
209
211
  status: "fail",
210
212
  scope: "issue:dispatch",
211
213
  message: `Issue is parked in ${issue.factoryState} without an active run`,
212
214
  };
213
215
  }
214
- if (issue.factoryState === "delegated" && issue.activeRunId === undefined && !readyForExecution && ageMs >= RECONCILIATION_GRACE_MS) {
216
+ if (!pausedNoPrWork && issue.factoryState === "delegated" && issue.activeRunId === undefined && !readyForExecution && ageMs >= RECONCILIATION_GRACE_MS) {
215
217
  return {
216
218
  status: "fail",
217
219
  scope: "issue:dispatch",
@@ -1,3 +1,4 @@
1
+ import { isUndelegatedPausedIssue } from "../../paused-issue-state.js";
1
2
  const GLYPH = {
2
3
  running: "\u25cf",
3
4
  queued: "\u25cb",
@@ -13,6 +14,9 @@ const COLOR = {
13
14
  attention: "red",
14
15
  };
15
16
  export function issueTokenFor(issue) {
17
+ if (isUndelegatedPausedIssue(issue)) {
18
+ return { glyph: GLYPH.queued, color: COLOR.queued, kind: "queued", phrase: phraseForPaused(issue) };
19
+ }
16
20
  if (issue.factoryState === "done") {
17
21
  return { glyph: GLYPH.approved, color: COLOR.approved, kind: "approved", phrase: "done" };
18
22
  }
@@ -53,6 +57,24 @@ function phraseForRunning(issue) {
53
57
  return issue.factoryState;
54
58
  }
55
59
  }
60
+ function phraseForPaused(issue) {
61
+ switch (issue.factoryState) {
62
+ case "implementing":
63
+ return "paused impl";
64
+ case "pr_open":
65
+ return "paused pr";
66
+ case "changes_requested":
67
+ return "paused review";
68
+ case "repairing_ci":
69
+ return "paused ci";
70
+ case "awaiting_queue":
71
+ return "paused queue";
72
+ case "repairing_queue":
73
+ return "paused merge";
74
+ default:
75
+ return "paused";
76
+ }
77
+ }
56
78
  export function prTokenFor(issue) {
57
79
  if (issue.prNumber === undefined)
58
80
  return null;
@@ -234,6 +234,7 @@ export class TrackedIssueListQuery {
234
234
  ...(row.title !== null ? { title: String(row.title) } : {}),
235
235
  ...(statusNoteForReturn ? { statusNote: statusNoteForReturn } : {}),
236
236
  projectId: String(row.project_id),
237
+ delegatedToPatchRelay: row.delegated_to_patchrelay === null ? true : Number(row.delegated_to_patchrelay) !== 0,
237
238
  ...(row.session_state !== null ? { sessionState: String(row.session_state) } : {}),
238
239
  factoryState: String(row.factory_state ?? "delegated"),
239
240
  blockedByCount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.47.0",
3
+ "version": "0.47.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {