patchrelay 0.12.0 → 0.12.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.
- package/dist/build-info.json +3 -3
- package/dist/factory-state.js +5 -3
- package/dist/run-orchestrator.js +11 -1
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/factory-state.js
CHANGED
|
@@ -14,11 +14,11 @@ export const ALLOWED_TRANSITIONS = {
|
|
|
14
14
|
delegated: ["preparing", "failed"],
|
|
15
15
|
preparing: ["implementing", "failed"],
|
|
16
16
|
implementing: ["pr_open", "awaiting_input", "failed", "escalated"],
|
|
17
|
-
pr_open: ["awaiting_review", "repairing_ci", "failed"],
|
|
17
|
+
pr_open: ["awaiting_review", "awaiting_queue", "changes_requested", "repairing_ci", "failed"],
|
|
18
18
|
awaiting_review: ["changes_requested", "awaiting_queue", "repairing_ci"],
|
|
19
19
|
changes_requested: ["implementing", "awaiting_input", "escalated"],
|
|
20
20
|
repairing_ci: ["pr_open", "awaiting_review", "escalated", "failed"],
|
|
21
|
-
awaiting_queue: ["done", "repairing_queue", "repairing_ci"],
|
|
21
|
+
awaiting_queue: ["done", "repairing_queue", "repairing_ci", "changes_requested"],
|
|
22
22
|
repairing_queue: ["pr_open", "awaiting_review", "awaiting_queue", "escalated", "failed"],
|
|
23
23
|
awaiting_input: ["implementing", "delegated", "escalated"],
|
|
24
24
|
escalated: [],
|
|
@@ -34,7 +34,9 @@ export function resolveFactoryStateFromGitHub(triggerEvent, current) {
|
|
|
34
34
|
case "review_approved":
|
|
35
35
|
return current === "awaiting_review" || current === "pr_open" ? "awaiting_queue" : undefined;
|
|
36
36
|
case "review_changes_requested":
|
|
37
|
-
return current === "awaiting_review" || current === "pr_open"
|
|
37
|
+
return current === "awaiting_review" || current === "pr_open" || current === "awaiting_queue"
|
|
38
|
+
? "changes_requested"
|
|
39
|
+
: undefined;
|
|
38
40
|
case "review_commented":
|
|
39
41
|
return undefined; // informational only
|
|
40
42
|
case "check_passed":
|
package/dist/run-orchestrator.js
CHANGED
|
@@ -171,8 +171,18 @@ export class RunOrchestrator {
|
|
|
171
171
|
}
|
|
172
172
|
// Reuse the existing thread only for review_fix (reviewer context matters).
|
|
173
173
|
// Implementation, ci_repair, and queue_repair get fresh threads.
|
|
174
|
+
// Fall back to a fresh thread if the stored one is stale (e.g. after app-server restart).
|
|
174
175
|
if (issue.threadId && runType === "review_fix") {
|
|
175
|
-
|
|
176
|
+
try {
|
|
177
|
+
await this.codex.readThread(issue.threadId, false);
|
|
178
|
+
threadId = issue.threadId;
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
this.logger.info({ issueKey: issue.issueKey, staleThreadId: issue.threadId }, "Stored thread is stale, starting fresh for review_fix");
|
|
182
|
+
const thread = await this.codex.startThread({ cwd: worktreePath });
|
|
183
|
+
threadId = thread.id;
|
|
184
|
+
this.db.upsertIssue({ projectId: item.projectId, linearIssueId: item.issueId, threadId });
|
|
185
|
+
}
|
|
176
186
|
}
|
|
177
187
|
else {
|
|
178
188
|
const thread = await this.codex.startThread({ cwd: worktreePath });
|