@love-moon/conductor-cli 0.2.33 → 0.2.34
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/bin/conductor-fire.js +29 -42
- package/package.json +4 -4
package/bin/conductor-fire.js
CHANGED
|
@@ -760,7 +760,13 @@ async function main() {
|
|
|
760
760
|
process.off("SIGINT", onSigint);
|
|
761
761
|
process.off("SIGTERM", onSigterm);
|
|
762
762
|
if (!launchedByDaemon) {
|
|
763
|
+
const remoteStopReason = typeof runner.getRemoteStopReason === "function" ? runner.getRemoteStopReason() : null;
|
|
763
764
|
const remoteStopSummary = typeof runner.getRemoteStopSummary === "function" ? runner.getRemoteStopSummary() : null;
|
|
765
|
+
// When the task was deleted by the user, the DB record is already gone —
|
|
766
|
+
// attempting to send a final status update would fail with 500 and the
|
|
767
|
+
// SDK durable outbox would retry forever, preventing the process from
|
|
768
|
+
// exiting.
|
|
769
|
+
const taskDeletedByUser = remoteStopReason === "deleted_by_user";
|
|
764
770
|
const finalStatus = shutdownSignal
|
|
765
771
|
? {
|
|
766
772
|
status: "KILLED",
|
|
@@ -780,16 +786,25 @@ async function main() {
|
|
|
780
786
|
status: "COMPLETED",
|
|
781
787
|
summary: "conductor fire exited",
|
|
782
788
|
};
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
789
|
+
if (!taskDeletedByUser) {
|
|
790
|
+
try {
|
|
791
|
+
const statusResult = await conductor.sendTaskStatus(taskContext.taskId, finalStatus);
|
|
792
|
+
if (statusResult?.pending && typeof conductor.flushPendingUpstreamEvents === "function") {
|
|
793
|
+
await conductor.flushPendingUpstreamEvents({
|
|
794
|
+
timeoutMs: 5_000,
|
|
795
|
+
retryIntervalMs: 250,
|
|
796
|
+
});
|
|
797
|
+
}
|
|
798
|
+
} catch (error) {
|
|
799
|
+
log(`Failed to report task status (${finalStatus.status}): ${error?.message || error}`);
|
|
800
|
+
}
|
|
801
|
+
} else {
|
|
802
|
+
log(`Skipping final status report: task was deleted by user`);
|
|
803
|
+
// Also clear any pending durable outbox retries (e.g. task_stop_ack)
|
|
804
|
+
// that would keep failing against the deleted task.
|
|
805
|
+
if (typeof conductor.clearDurableOutboxTimer === "function") {
|
|
806
|
+
conductor.clearDurableOutboxTimer();
|
|
790
807
|
}
|
|
791
|
-
} catch (error) {
|
|
792
|
-
log(`Failed to report task status (${finalStatus.status}): ${error?.message || error}`);
|
|
793
808
|
}
|
|
794
809
|
}
|
|
795
810
|
if (shutdownSignal === "SIGINT") {
|
|
@@ -1269,39 +1284,7 @@ export async function resolveProjectId(conductor, explicit, opts = {}) {
|
|
|
1269
1284
|
log(`Unable to match project by path: ${error.message}`);
|
|
1270
1285
|
}
|
|
1271
1286
|
|
|
1272
|
-
|
|
1273
|
-
const created = await conductor.createProject({
|
|
1274
|
-
name: projectName,
|
|
1275
|
-
bindingConfirmed: true,
|
|
1276
|
-
daemonHost,
|
|
1277
|
-
workspacePath: snapshot.projectRoot,
|
|
1278
|
-
repoRoot: snapshot.repoRoot,
|
|
1279
|
-
worktreeBranch: snapshot.worktreeBranch,
|
|
1280
|
-
lastCommit: snapshot.lastCommit,
|
|
1281
|
-
fileCount: snapshot.fileCount,
|
|
1282
|
-
});
|
|
1283
|
-
if (created?.id) {
|
|
1284
|
-
log(`Created bound project ${created.name || created.id} for ${daemonHost}:${snapshot.projectRoot}`);
|
|
1285
|
-
return created.id;
|
|
1286
|
-
}
|
|
1287
|
-
throw new Error("create_project returned no id");
|
|
1288
|
-
} catch (error) {
|
|
1289
|
-
log(`Unable to create bound project: ${error.message}`);
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
try {
|
|
1293
|
-
const retryMatch = await conductor.matchProjectByPath({
|
|
1294
|
-
daemon_host: daemonHost,
|
|
1295
|
-
project_path: snapshot.projectRoot,
|
|
1296
|
-
});
|
|
1297
|
-
if (retryMatch?.project_id) {
|
|
1298
|
-
return retryMatch.project_id;
|
|
1299
|
-
}
|
|
1300
|
-
} catch {
|
|
1301
|
-
// ignore retry match failures
|
|
1302
|
-
}
|
|
1303
|
-
|
|
1304
|
-
log(`Unable to resolve bound project for ${daemonHost}:${snapshot.projectRoot}, falling back to default`);
|
|
1287
|
+
log(`No matching project found for ${daemonHost}:${snapshot.projectRoot}, falling back to default`);
|
|
1305
1288
|
return resolveDefaultProjectId(conductor);
|
|
1306
1289
|
}
|
|
1307
1290
|
|
|
@@ -1807,6 +1790,10 @@ export class BridgeRunner {
|
|
|
1807
1790
|
return this.stopped || Boolean(this.remoteStopInfo);
|
|
1808
1791
|
}
|
|
1809
1792
|
|
|
1793
|
+
getRemoteStopReason() {
|
|
1794
|
+
return this.remoteStopInfo?.reason || null;
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1810
1797
|
getRemoteStopSummary() {
|
|
1811
1798
|
if (!this.remoteStopInfo) {
|
|
1812
1799
|
return null;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@love-moon/conductor-cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"gitCommitId": "
|
|
3
|
+
"version": "0.2.34",
|
|
4
|
+
"gitCommitId": "c3c936c",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"conductor": "bin/conductor.js"
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@love-moon/ai-bridge": "0.1.4",
|
|
21
|
-
"@love-moon/ai-sdk": "0.2.
|
|
22
|
-
"@love-moon/conductor-sdk": "0.2.
|
|
21
|
+
"@love-moon/ai-sdk": "0.2.34",
|
|
22
|
+
"@love-moon/conductor-sdk": "0.2.34",
|
|
23
23
|
"chrome-launcher": "^1.2.1",
|
|
24
24
|
"chrome-remote-interface": "^0.33.0",
|
|
25
25
|
"dotenv": "^16.4.5",
|