@rallycry/conveyor-agent 4.2.1 → 4.3.0
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.
|
@@ -869,7 +869,6 @@ async function processEvents(events, context, host) {
|
|
|
869
869
|
for await (const event of events) {
|
|
870
870
|
if (host.isStopped()) break;
|
|
871
871
|
if (host.pendingModeRestart) {
|
|
872
|
-
host.pendingModeRestart = false;
|
|
873
872
|
if (isTyping) {
|
|
874
873
|
host.connection.sendTypingStop();
|
|
875
874
|
}
|
|
@@ -3405,7 +3404,7 @@ var ProjectRunner = class {
|
|
|
3405
3404
|
console.log(`[task:${shortId}] Warning: git fetch failed`);
|
|
3406
3405
|
}
|
|
3407
3406
|
let workDir;
|
|
3408
|
-
const shouldWorktree = useWorktree
|
|
3407
|
+
const shouldWorktree = useWorktree === true;
|
|
3409
3408
|
if (shouldWorktree) {
|
|
3410
3409
|
workDir = ensureWorktree(this.projectDir, taskId, devBranch);
|
|
3411
3410
|
} else {
|
|
@@ -3437,7 +3436,7 @@ var ProjectRunner = class {
|
|
|
3437
3436
|
CONVEYOR_USE_WORKTREE: "false",
|
|
3438
3437
|
CONVEYOR_AGENT_MODE: isAuto ? "auto" : "",
|
|
3439
3438
|
CONVEYOR_IS_AUTO: isAuto ? "true" : "false",
|
|
3440
|
-
CONVEYOR_USE_SANDBOX: useSandbox ===
|
|
3439
|
+
CONVEYOR_USE_SANDBOX: useSandbox === true ? "true" : "false"
|
|
3441
3440
|
},
|
|
3442
3441
|
cwd: workDir,
|
|
3443
3442
|
stdio: ["pipe", "pipe", "pipe", "ipc"]
|
|
@@ -3460,7 +3459,12 @@ var ProjectRunner = class {
|
|
|
3460
3459
|
console.error(`[task:${shortId}] ${line}`);
|
|
3461
3460
|
}
|
|
3462
3461
|
});
|
|
3463
|
-
this.activeAgents.set(taskId, {
|
|
3462
|
+
this.activeAgents.set(taskId, {
|
|
3463
|
+
process: child,
|
|
3464
|
+
worktreePath: workDir,
|
|
3465
|
+
mode,
|
|
3466
|
+
usesWorktree: shouldWorktree
|
|
3467
|
+
});
|
|
3464
3468
|
this.connection.emitTaskStarted(taskId);
|
|
3465
3469
|
console.log(`[project-runner] Started task ${shortId} in ${mode} mode at ${workDir}`);
|
|
3466
3470
|
child.on("exit", (code) => {
|
|
@@ -3468,7 +3472,7 @@ var ProjectRunner = class {
|
|
|
3468
3472
|
const reason = code === 0 ? "completed" : `exited with code ${code}`;
|
|
3469
3473
|
this.connection.emitTaskStopped(taskId, reason);
|
|
3470
3474
|
console.log(`[project-runner] Task ${shortId} ${reason}`);
|
|
3471
|
-
if (code === 0) {
|
|
3475
|
+
if (code === 0 && shouldWorktree) {
|
|
3472
3476
|
try {
|
|
3473
3477
|
removeWorktree(this.projectDir, taskId);
|
|
3474
3478
|
} catch {
|
|
@@ -3499,9 +3503,11 @@ var ProjectRunner = class {
|
|
|
3499
3503
|
}, STOP_TIMEOUT_MS);
|
|
3500
3504
|
agent.process.on("exit", () => {
|
|
3501
3505
|
clearTimeout(timer);
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3506
|
+
if (agent.usesWorktree) {
|
|
3507
|
+
try {
|
|
3508
|
+
removeWorktree(this.projectDir, taskId);
|
|
3509
|
+
} catch {
|
|
3510
|
+
}
|
|
3505
3511
|
}
|
|
3506
3512
|
});
|
|
3507
3513
|
}
|
|
@@ -3615,4 +3621,4 @@ export {
|
|
|
3615
3621
|
ProjectRunner,
|
|
3616
3622
|
FileCache
|
|
3617
3623
|
};
|
|
3618
|
-
//# sourceMappingURL=chunk-
|
|
3624
|
+
//# sourceMappingURL=chunk-NUD2M24L.js.map
|