@m0xoo/openboard 1.0.14 → 1.0.15
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/package.json
CHANGED
|
@@ -334,6 +334,7 @@ export async function setupOpencodeEventListener(events, opencodeClient, session
|
|
|
334
334
|
port: 4096,
|
|
335
335
|
url: agentUrl,
|
|
336
336
|
pr_url: prUrl,
|
|
337
|
+
pr_status: 'OPEN',
|
|
337
338
|
total_cost: rawSessionCost > 0 ? Number(rawSessionCost.toFixed(4)) : undefined
|
|
338
339
|
});
|
|
339
340
|
}
|
|
@@ -36,20 +36,18 @@ export class GhWorker {
|
|
|
36
36
|
}
|
|
37
37
|
if (!sessions || sessions.length === 0)
|
|
38
38
|
continue;
|
|
39
|
-
// Check each session that has a pr_url but no final pr_status
|
|
40
|
-
let updated = false;
|
|
41
39
|
for (let i = sessions.length - 1; i >= 0; i--) {
|
|
42
40
|
const session = sessions[i];
|
|
43
41
|
if (session.pr_url && (!session.pr_status || session.pr_status === 'OPEN')) {
|
|
44
42
|
try {
|
|
45
|
-
console.log(`[gh-worker] Checking PR status for ticket ${row.id}: ${session.pr_url}`);
|
|
46
43
|
const { stdout } = await execFileAsync('gh', ['pr', 'view', session.pr_url, '--json', 'state'], { shell: true });
|
|
47
44
|
const data = JSON.parse(stdout);
|
|
48
45
|
const newState = data.state; // 'OPEN', 'MERGED', 'CLOSED'
|
|
49
46
|
if (newState && newState !== session.pr_status) {
|
|
50
47
|
console.log(`[gh-worker] PR status changed from ${session.pr_status} to ${newState} for ticket ${row.id}`);
|
|
48
|
+
// Update this specific session
|
|
51
49
|
session.pr_status = newState;
|
|
52
|
-
|
|
50
|
+
ticketRepository.updateAgentSession(row.id, session);
|
|
53
51
|
if (newState === 'MERGED') {
|
|
54
52
|
commentRepository.create({
|
|
55
53
|
ticketId: row.id,
|
|
@@ -71,9 +69,6 @@ export class GhWorker {
|
|
|
71
69
|
}
|
|
72
70
|
}
|
|
73
71
|
}
|
|
74
|
-
if (updated) {
|
|
75
|
-
ticketRepository.updateAgentSession(row.id, sessions[sessions.length - 1]);
|
|
76
|
-
}
|
|
77
72
|
}
|
|
78
73
|
}
|
|
79
74
|
catch (err) {
|