patchrelay 0.36.12 → 0.36.13

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.36.12",
4
- "commit": "c36b9a22a748",
5
- "builtAt": "2026-04-09T21:06:16.158Z"
3
+ "version": "0.36.13",
4
+ "commit": "e015f208d2a5",
5
+ "builtAt": "2026-04-10T03:05:43.066Z"
6
6
  }
@@ -62,20 +62,51 @@ export function buildRunStartedActivity(runType) {
62
62
  }
63
63
  }
64
64
  export function buildRunCompletedActivity(params) {
65
- const label = formatRunTypeLabel(params.runType);
66
- const nextState = describeNextState(params.postRunState, params.prNumber);
65
+ const prLabel = params.prNumber ? `PR #${params.prNumber}` : "the pull request";
67
66
  const summary = trimSummary(params.completionSummary);
68
- const lines = [`${label} completed.`];
69
- if (nextState) {
70
- lines.push("", nextState);
71
- }
72
- if (summary) {
73
- lines.push("", summary);
67
+ const detail = summary ? ` ${summary}` : "";
68
+ switch (params.runType) {
69
+ case "implementation":
70
+ if (params.postRunState === "pr_open") {
71
+ return {
72
+ type: "response",
73
+ body: `${prLabel} opened:${detail || " Published and ready for review."}`,
74
+ };
75
+ }
76
+ return undefined;
77
+ case "review_fix":
78
+ return {
79
+ type: "response",
80
+ body: `Updated ${prLabel} to address review feedback.${detail}`,
81
+ };
82
+ case "ci_repair":
83
+ return {
84
+ type: "response",
85
+ body: `Updated ${prLabel} after CI repair.${detail}`,
86
+ };
87
+ case "queue_repair":
88
+ return {
89
+ type: "response",
90
+ body: `Updated ${prLabel} after merge-queue repair.${detail}`,
91
+ };
92
+ case "branch_upkeep":
93
+ return undefined;
94
+ default: {
95
+ const label = formatRunTypeLabel(params.runType);
96
+ const nextState = describeNextState(params.postRunState, params.prNumber);
97
+ const lines = [`${label} completed.`];
98
+ if (nextState) {
99
+ lines.push("", nextState);
100
+ }
101
+ if (summary) {
102
+ lines.push("", summary);
103
+ }
104
+ return {
105
+ type: "response",
106
+ body: lines.join("\n"),
107
+ };
108
+ }
74
109
  }
75
- return {
76
- type: "response",
77
- body: lines.join("\n"),
78
- };
79
110
  }
80
111
  export function buildRunFailureActivity(runType, reason) {
81
112
  const label = formatRunTypeLabel(runType);
@@ -92,33 +123,16 @@ export function buildStopConfirmationActivity() {
92
123
  }
93
124
  export function buildGitHubStateActivity(newState, event) {
94
125
  switch (newState) {
95
- case "pr_open": {
96
- const parts = [`PR #${event.prNumber ?? "?"} is open and ready for review.`];
97
- if (event.prUrl) {
98
- parts.push("", event.prUrl);
99
- }
100
- return { type: "response", body: parts.join("\n") };
101
- }
126
+ case "pr_open":
127
+ return undefined;
102
128
  case "awaiting_queue":
103
- return { type: "response", body: "Review approved. PatchRelay is moving the PR toward merge." };
129
+ return undefined;
104
130
  case "changes_requested":
105
- return {
106
- type: "action",
107
- action: "Addressing",
108
- parameter: event.reviewerName ? `review feedback from ${event.reviewerName}` : "review feedback",
109
- };
131
+ return undefined;
110
132
  case "repairing_ci":
111
- return {
112
- type: "action",
113
- action: "Repairing",
114
- parameter: event.checkName ? `CI failure: ${event.checkName}` : "failing CI checks",
115
- };
133
+ return undefined;
116
134
  case "repairing_queue":
117
- return {
118
- type: "action",
119
- action: "Repairing",
120
- parameter: "merge queue validation",
121
- };
135
+ return undefined;
122
136
  case "done":
123
137
  return { type: "response", body: `PR merged.${event.prNumber ? ` PR #${event.prNumber}` : ""}` };
124
138
  case "failed":
@@ -159,12 +159,15 @@ export class RunFinalizer {
159
159
  });
160
160
  const updatedIssue = this.db.issues.getIssue(run.projectId, run.linearIssueId) ?? refreshedIssue;
161
161
  const completionSummary = report.assistantMessages.at(-1)?.slice(0, 300) ?? `${run.runType} completed.`;
162
- void this.linearSync.emitActivity(updatedIssue, buildRunCompletedActivity({
162
+ const linearActivity = buildRunCompletedActivity({
163
163
  runType: run.runType,
164
164
  completionSummary,
165
165
  postRunState: updatedIssue.factoryState,
166
166
  ...(updatedIssue.prNumber !== undefined ? { prNumber: updatedIssue.prNumber } : {}),
167
- }));
167
+ });
168
+ if (linearActivity) {
169
+ void this.linearSync.emitActivity(updatedIssue, linearActivity);
170
+ }
168
171
  void this.linearSync.syncSession(updatedIssue);
169
172
  this.linearSync.clearProgress(run.id);
170
173
  this.releaseLease(run.projectId, run.linearIssueId);
@@ -46,13 +46,12 @@ export class AgentSessionHandler {
46
46
  await this.publishAgentActivity(linear, normalized.agentSession.id, buildAlreadyRunningThought(activeRun.runType));
47
47
  return;
48
48
  }
49
- const blockerSummary = trackedIssue?.blockedByCount
50
- ? `PatchRelay is delegated and waiting on blockers to reach Done: ${trackedIssue.blockedByKeys.join(", ")}.`
51
- : "PatchRelay is delegated, but no work is queued. Delegate the issue or move it to Start to trigger implementation.";
52
- await this.publishAgentActivity(linear, normalized.agentSession.id, {
53
- type: "elicitation",
54
- body: blockerSummary,
55
- });
49
+ if (!trackedIssue?.blockedByCount) {
50
+ await this.publishAgentActivity(linear, normalized.agentSession.id, {
51
+ type: "elicitation",
52
+ body: "PatchRelay is delegated, but no work is queued. Delegate the issue or move it to Start to trigger implementation.",
53
+ });
54
+ }
56
55
  return;
57
56
  }
58
57
  if (normalized.triggerEvent === "agentSignal" && normalized.agentSession.signal === "stop") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "patchrelay",
3
- "version": "0.36.12",
3
+ "version": "0.36.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "repository": {