@openboard/start 1.0.24 â 1.0.25
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
|
@@ -142,16 +142,16 @@ sessionID, ticket, agentUrl, config, activeSessions, worktreePath, originalWorks
|
|
|
142
142
|
const latestSession = sessionsForColumn[sessionsForColumn.length - 1];
|
|
143
143
|
const hasError = latestSession?.status === 'blocked';
|
|
144
144
|
if (!hasError) {
|
|
145
|
-
// Mark the ticket as done now that the agent session finished processing
|
|
146
|
-
ticketRepository.updateAgentSession(ticket.id, {
|
|
147
|
-
column_id: ticket.column_id,
|
|
148
|
-
agent_type: agentType,
|
|
149
|
-
status: 'done',
|
|
150
|
-
port: 4096,
|
|
151
|
-
url: agentUrl,
|
|
152
|
-
total_cost: rawSessionCost > 0 ? Number(rawSessionCost.toFixed(4)) : undefined
|
|
153
|
-
});
|
|
154
145
|
if (agentType === 'code_review') {
|
|
146
|
+
// Mark the ticket as done now that the agent session finished processing
|
|
147
|
+
ticketRepository.updateAgentSession(ticket.id, {
|
|
148
|
+
column_id: ticket.column_id,
|
|
149
|
+
agent_type: agentType,
|
|
150
|
+
status: 'done',
|
|
151
|
+
port: 4096,
|
|
152
|
+
url: agentUrl,
|
|
153
|
+
total_cost: rawSessionCost > 0 ? Number(rawSessionCost.toFixed(4)) : undefined
|
|
154
|
+
});
|
|
155
155
|
try {
|
|
156
156
|
// Find out if the PR was approved or changes requested
|
|
157
157
|
const latestTicket = ticketRepository.findById(ticket.id) || ticket;
|
|
@@ -266,7 +266,7 @@ sessionID, ticket, agentUrl, config, activeSessions, worktreePath, originalWorks
|
|
|
266
266
|
prUrl = prOut.trim();
|
|
267
267
|
updateSessionComment(`đ **Pull Request Created**\n\nThe agent has proposed the following changes in a PR. Check it out:\n${prUrl}${rawSessionCost > 0 ? `\n\n**Total Cost:** $${rawSessionCost.toFixed(4)}` : ''}`, 'pr');
|
|
268
268
|
}
|
|
269
|
-
// Add PR URL to the active agent session
|
|
269
|
+
// Add PR URL to the active agent session and mark as done
|
|
270
270
|
ticketRepository.updateAgentSession(ticket.id, {
|
|
271
271
|
column_id: ticket.column_id,
|
|
272
272
|
agent_type: 'opencode',
|
|
@@ -276,24 +276,50 @@ sessionID, ticket, agentUrl, config, activeSessions, worktreePath, originalWorks
|
|
|
276
276
|
pr_url: prUrl,
|
|
277
277
|
total_cost: rawSessionCost > 0 ? Number(rawSessionCost.toFixed(4)) : undefined
|
|
278
278
|
});
|
|
279
|
+
// Move ticket to the configured destination column (if set)
|
|
280
|
+
if (config.on_finish_column_id) {
|
|
281
|
+
console.log(`[opencode-agent] Moving ticket ${ticket.id} to column ${config.on_finish_column_id}`);
|
|
282
|
+
const moved = ticketRepository.move(ticket.id, config.on_finish_column_id, 0);
|
|
283
|
+
if (moved) {
|
|
284
|
+
// Trigger via the queue so concurrency/priority rules are respected
|
|
285
|
+
agentQueue.evaluateColumnQueue(config.on_finish_column_id);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
279
288
|
}
|
|
280
289
|
else {
|
|
281
290
|
console.log(`[opencode-agent] No changes to push for ticket ${ticket.id}.`);
|
|
282
291
|
updateSessionComment(`âšī¸ **Task Completed (No Changes)**\n\nThe agent finished the task but did not make any code changes.${rawSessionCost > 0 ? `\n\n**Total Cost:** $${rawSessionCost.toFixed(4)}` : ''}`, 'status');
|
|
292
|
+
// Mark as done even if no changes
|
|
293
|
+
ticketRepository.updateAgentSession(ticket.id, {
|
|
294
|
+
column_id: ticket.column_id,
|
|
295
|
+
agent_type: 'opencode',
|
|
296
|
+
status: 'done',
|
|
297
|
+
port: 4096,
|
|
298
|
+
url: agentUrl,
|
|
299
|
+
total_cost: rawSessionCost > 0 ? Number(rawSessionCost.toFixed(4)) : undefined
|
|
300
|
+
});
|
|
301
|
+
// Still move to the next column if no changes (assumed done)
|
|
302
|
+
if (config.on_finish_column_id) {
|
|
303
|
+
console.log(`[opencode-agent] Moving ticket ${ticket.id} to column ${config.on_finish_column_id}`);
|
|
304
|
+
const moved = ticketRepository.move(ticket.id, config.on_finish_column_id, 0);
|
|
305
|
+
if (moved) {
|
|
306
|
+
agentQueue.evaluateColumnQueue(config.on_finish_column_id);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
283
309
|
}
|
|
284
310
|
}
|
|
285
311
|
catch (error) {
|
|
286
312
|
console.error(`[opencode-agent] Failed to create PR for ticket ${ticket.id}`, error);
|
|
287
313
|
updateSessionComment(`â **Failed to Create PR**\n\nThe agent finished the task, but an error occurred while pushing changes or creating the PR:\n\`\`\`\n${error.message}\n\`\`\``, 'status');
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
314
|
+
// Mark as blocked due to PR failure
|
|
315
|
+
ticketRepository.updateAgentSession(ticket.id, {
|
|
316
|
+
column_id: ticket.column_id,
|
|
317
|
+
agent_type: 'opencode',
|
|
318
|
+
status: 'blocked',
|
|
319
|
+
port: 4096,
|
|
320
|
+
url: agentUrl,
|
|
321
|
+
error_message: `PR creation failed: ${error.message}`
|
|
322
|
+
});
|
|
297
323
|
}
|
|
298
324
|
} // End of agentType === 'opencode' block
|
|
299
325
|
}
|