Skip to content

Commit f280571

Browse files
committed
fix: move ticket to backlog on sandbox errors
1 parent cb74276 commit f280571

2 files changed

Lines changed: 20 additions & 2 deletions

File tree

src/workflows/implementation.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,16 @@ export async function implementationWorkflow(ticketId: string) {
142142

143143
const requirementsMd = await assembleImplementationRequirements(ticket);
144144

145-
const { output, files } = await runAgentInSandbox(branchName, requirementsMd);
145+
let output: AgentOutput;
146+
let files: Array<{ path: string; content: string }>;
147+
try {
148+
({ output, files } = await runAgentInSandbox(branchName, requirementsMd));
149+
} catch (err) {
150+
await moveTicket(ticketId, env.COLUMN_BACKLOG);
151+
await notifySlack(`Task ${ticket.identifier} sandbox error: ${(err as Error).message ?? "unknown"}`);
152+
await unregisterRun(ticket.identifier);
153+
throw err;
154+
}
146155

147156
await pushChanges(branchName, files);
148157

src/workflows/review-fix.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,16 @@ export async function reviewFixWorkflow(
136136
hasConflicts,
137137
);
138138

139-
const { output, files } = await runFixingAgentInSandbox(branchName, requirementsMd);
139+
let output: AgentOutput;
140+
let files: Array<{ path: string; content: string }>;
141+
try {
142+
({ output, files } = await runFixingAgentInSandbox(branchName, requirementsMd));
143+
} catch (err) {
144+
await moveTicket(ticketId, env.COLUMN_BACKLOG);
145+
await notifySlack(`Task ${ticket.identifier} sandbox error: ${(err as Error).message ?? "unknown"}`);
146+
await unregisterRun(ticket.identifier);
147+
throw err;
148+
}
140149

141150
await pushChanges(branchName, files);
142151

0 commit comments

Comments
 (0)