chatroom-cli 1.11.0 → 1.11.2
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/dist/index.js +194 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11134,34 +11134,10 @@ var init_daemon_state = __esm(() => {
|
|
|
11134
11134
|
STATE_DIR = join4(CHATROOM_DIR3, "machines", "state");
|
|
11135
11135
|
});
|
|
11136
11136
|
|
|
11137
|
-
// src/infrastructure/machine/intentional-stops.ts
|
|
11138
|
-
function agentKey2(chatroomId, role) {
|
|
11139
|
-
return `${chatroomId}:${role.toLowerCase()}`;
|
|
11140
|
-
}
|
|
11141
|
-
function markIntentionalStop(chatroomId, role, reason = "user.stop") {
|
|
11142
|
-
pendingStops.set(agentKey2(chatroomId, role), reason);
|
|
11143
|
-
}
|
|
11144
|
-
function consumeIntentionalStop(chatroomId, role) {
|
|
11145
|
-
const key = agentKey2(chatroomId, role);
|
|
11146
|
-
const reason = pendingStops.get(key) ?? null;
|
|
11147
|
-
if (reason !== null) {
|
|
11148
|
-
pendingStops.delete(key);
|
|
11149
|
-
}
|
|
11150
|
-
return reason;
|
|
11151
|
-
}
|
|
11152
|
-
function clearIntentionalStop(chatroomId, role) {
|
|
11153
|
-
pendingStops.delete(agentKey2(chatroomId, role));
|
|
11154
|
-
}
|
|
11155
|
-
var pendingStops;
|
|
11156
|
-
var init_intentional_stops = __esm(() => {
|
|
11157
|
-
pendingStops = new Map;
|
|
11158
|
-
});
|
|
11159
|
-
|
|
11160
11137
|
// src/infrastructure/machine/index.ts
|
|
11161
11138
|
var init_machine = __esm(() => {
|
|
11162
11139
|
init_storage2();
|
|
11163
11140
|
init_daemon_state();
|
|
11164
|
-
init_intentional_stops();
|
|
11165
11141
|
});
|
|
11166
11142
|
|
|
11167
11143
|
// src/commands/auth-status/index.ts
|
|
@@ -14285,11 +14261,16 @@ function formatTimestamp() {
|
|
|
14285
14261
|
return new Date().toISOString().replace("T", " ").substring(0, 19);
|
|
14286
14262
|
}
|
|
14287
14263
|
|
|
14264
|
+
// src/commands/machine/daemon-start/types.ts
|
|
14265
|
+
function agentKey2(chatroomId, role) {
|
|
14266
|
+
return `${chatroomId}:${role.toLowerCase()}`;
|
|
14267
|
+
}
|
|
14268
|
+
|
|
14288
14269
|
// src/events/lifecycle/on-agent-shutdown.ts
|
|
14289
14270
|
async function onAgentShutdown(ctx, options) {
|
|
14290
14271
|
const { chatroomId, role, pid, skipKill } = options;
|
|
14291
14272
|
try {
|
|
14292
|
-
ctx.
|
|
14273
|
+
ctx.pendingStops.set(agentKey2(chatroomId, role), options.stopReason ?? "user.stop");
|
|
14293
14274
|
} catch (e) {
|
|
14294
14275
|
console.log(` ⚠️ Failed to mark intentional stop for ${role}: ${e.message}`);
|
|
14295
14276
|
}
|
|
@@ -14349,6 +14330,7 @@ async function onAgentShutdown(ctx, options) {
|
|
|
14349
14330
|
cleaned: killed || (skipKill ?? false)
|
|
14350
14331
|
};
|
|
14351
14332
|
}
|
|
14333
|
+
var init_on_agent_shutdown = () => {};
|
|
14352
14334
|
|
|
14353
14335
|
// src/events/lifecycle/on-daemon-shutdown.ts
|
|
14354
14336
|
async function onDaemonShutdown(ctx) {
|
|
@@ -14389,6 +14371,7 @@ async function onDaemonShutdown(ctx) {
|
|
|
14389
14371
|
var AGENT_SHUTDOWN_TIMEOUT_MS = 5000;
|
|
14390
14372
|
var init_on_daemon_shutdown = __esm(() => {
|
|
14391
14373
|
init_api3();
|
|
14374
|
+
init_on_agent_shutdown();
|
|
14392
14375
|
});
|
|
14393
14376
|
|
|
14394
14377
|
// src/commands/machine/daemon-start/handlers/shared.ts
|
|
@@ -14675,12 +14658,12 @@ class DaemonEventBus {
|
|
|
14675
14658
|
|
|
14676
14659
|
// src/events/daemon/agent/on-agent-exited.ts
|
|
14677
14660
|
function onAgentExited(ctx, payload) {
|
|
14678
|
-
const { chatroomId, role, pid, code: code2, signal, stopReason
|
|
14661
|
+
const { chatroomId, role, pid, code: code2, signal, stopReason } = payload;
|
|
14679
14662
|
const ts = formatTimestamp();
|
|
14680
14663
|
console.log(`[${ts}] Agent stopped: ${stopReason} (${role})`);
|
|
14681
14664
|
const isDaemonRespawn = stopReason === "daemon.respawn";
|
|
14682
|
-
const isIntentional =
|
|
14683
|
-
if (isIntentional) {
|
|
14665
|
+
const isIntentional = stopReason === "user.stop" || stopReason === "platform.team_switch" || stopReason === "agent_process.turn_end" || stopReason === "agent_process.turn_end_quick_fail";
|
|
14666
|
+
if (isIntentional && !isDaemonRespawn) {
|
|
14684
14667
|
console.log(`[${ts}] ℹ️ Agent process exited after intentional stop ` + `(PID: ${pid}, role: ${role}, code: ${code2}, signal: ${signal})`);
|
|
14685
14668
|
} else if (isDaemonRespawn) {
|
|
14686
14669
|
console.log(`[${ts}] \uD83D\uDD04 Agent process stopped for respawn ` + `(PID: ${pid}, role: ${role}, code: ${code2}, signal: ${signal})`);
|
|
@@ -14693,11 +14676,11 @@ function onAgentExited(ctx, payload) {
|
|
|
14693
14676
|
chatroomId,
|
|
14694
14677
|
role,
|
|
14695
14678
|
pid,
|
|
14696
|
-
intentional,
|
|
14697
14679
|
stopReason,
|
|
14698
14680
|
stopSignal: stopReason === "agent_process.signal" ? signal ?? undefined : undefined,
|
|
14699
14681
|
exitCode: code2 ?? undefined,
|
|
14700
|
-
signal: signal ?? undefined
|
|
14682
|
+
signal: signal ?? undefined,
|
|
14683
|
+
agentHarness: payload.agentHarness
|
|
14701
14684
|
}).catch((err) => {
|
|
14702
14685
|
console.log(` ⚠️ Failed to record agent exit event: ${err.message}`);
|
|
14703
14686
|
});
|
|
@@ -14773,11 +14756,6 @@ function createDefaultDeps19() {
|
|
|
14773
14756
|
fs: {
|
|
14774
14757
|
stat
|
|
14775
14758
|
},
|
|
14776
|
-
stops: {
|
|
14777
|
-
mark: markIntentionalStop,
|
|
14778
|
-
consume: consumeIntentionalStop,
|
|
14779
|
-
clear: clearIntentionalStop
|
|
14780
|
-
},
|
|
14781
14759
|
machine: {
|
|
14782
14760
|
clearAgentPid,
|
|
14783
14761
|
persistAgentPid,
|
|
@@ -14908,7 +14886,8 @@ async function initDaemon() {
|
|
|
14908
14886
|
events,
|
|
14909
14887
|
agentServices,
|
|
14910
14888
|
activeWorkingDirs: new Set,
|
|
14911
|
-
lastPushedGitState: new Map
|
|
14889
|
+
lastPushedGitState: new Map,
|
|
14890
|
+
pendingStops: new Map
|
|
14912
14891
|
};
|
|
14913
14892
|
registerEventListeners(ctx);
|
|
14914
14893
|
logStartup(ctx, availableModels);
|
|
@@ -14921,7 +14900,6 @@ var init_init2 = __esm(() => {
|
|
|
14921
14900
|
init_storage();
|
|
14922
14901
|
init_client2();
|
|
14923
14902
|
init_machine();
|
|
14924
|
-
init_intentional_stops();
|
|
14925
14903
|
init_remote_agents();
|
|
14926
14904
|
init_harness_spawning();
|
|
14927
14905
|
init_error_formatting();
|
|
@@ -15030,6 +15008,7 @@ async function executeStartAgent(ctx, args) {
|
|
|
15030
15008
|
return { result: msg2, failed: true };
|
|
15031
15009
|
}
|
|
15032
15010
|
const { pid } = spawnResult;
|
|
15011
|
+
const spawnedAt = Date.now();
|
|
15033
15012
|
const msg = `Agent spawned (PID: ${pid})`;
|
|
15034
15013
|
console.log(` ✅ ${msg}`);
|
|
15035
15014
|
ctx.deps.spawning.recordSpawn(chatroomId);
|
|
@@ -15058,7 +15037,11 @@ async function executeStartAgent(ctx, args) {
|
|
|
15058
15037
|
ctx.activeWorkingDirs.add(workingDir);
|
|
15059
15038
|
spawnResult.onExit(({ code: code2, signal }) => {
|
|
15060
15039
|
ctx.deps.spawning.recordExit(chatroomId);
|
|
15061
|
-
const
|
|
15040
|
+
const key = agentKey2(chatroomId, role);
|
|
15041
|
+
const pendingReason = ctx.pendingStops.get(key) ?? null;
|
|
15042
|
+
if (pendingReason) {
|
|
15043
|
+
ctx.pendingStops.delete(key);
|
|
15044
|
+
}
|
|
15062
15045
|
const stopReason = pendingReason ?? resolveStopReason(code2, signal, false);
|
|
15063
15046
|
ctx.events.emit("agent:exited", {
|
|
15064
15047
|
chatroomId,
|
|
@@ -15067,11 +15050,16 @@ async function executeStartAgent(ctx, args) {
|
|
|
15067
15050
|
code: code2,
|
|
15068
15051
|
signal,
|
|
15069
15052
|
stopReason,
|
|
15070
|
-
|
|
15053
|
+
agentHarness
|
|
15071
15054
|
});
|
|
15072
15055
|
});
|
|
15073
15056
|
if (spawnResult.onAgentEnd) {
|
|
15074
15057
|
spawnResult.onAgentEnd(() => {
|
|
15058
|
+
const elapsed = Date.now() - spawnedAt;
|
|
15059
|
+
const isHealthyTurn = elapsed >= MIN_HEALTHY_TURN_MS;
|
|
15060
|
+
const stopReason = isHealthyTurn ? "agent_process.turn_end" : "agent_process.turn_end_quick_fail";
|
|
15061
|
+
const key = agentKey2(chatroomId, role);
|
|
15062
|
+
ctx.pendingStops.set(key, stopReason);
|
|
15075
15063
|
try {
|
|
15076
15064
|
ctx.deps.processes.kill(-pid, "SIGTERM");
|
|
15077
15065
|
} catch {}
|
|
@@ -15091,23 +15079,27 @@ async function executeStartAgent(ctx, args) {
|
|
|
15091
15079
|
});
|
|
15092
15080
|
return { result: msg, failed: false };
|
|
15093
15081
|
}
|
|
15082
|
+
var MIN_HEALTHY_TURN_MS = 30000;
|
|
15094
15083
|
var init_start_agent = __esm(() => {
|
|
15095
15084
|
init_api3();
|
|
15096
15085
|
init_client2();
|
|
15086
|
+
init_on_agent_shutdown();
|
|
15097
15087
|
});
|
|
15098
15088
|
|
|
15099
15089
|
// src/events/daemon/agent/on-request-start-agent.ts
|
|
15100
15090
|
async function onRequestStartAgent(ctx, event) {
|
|
15091
|
+
const eventId = event._id.toString();
|
|
15101
15092
|
if (Date.now() > event.deadline) {
|
|
15102
|
-
console.log(`[daemon] ⏰ Skipping expired agent.requestStart for role=${event.role} (deadline passed)`);
|
|
15093
|
+
console.log(`[daemon] ⏰ Skipping expired agent.requestStart for role=${event.role} (id: ${eventId}, deadline passed)`);
|
|
15103
15094
|
return;
|
|
15104
15095
|
}
|
|
15105
15096
|
const spawnCheck = ctx.deps.spawning.shouldAllowSpawn(event.chatroomId, event.reason);
|
|
15106
15097
|
if (!spawnCheck.allowed) {
|
|
15107
15098
|
const retryMsg = spawnCheck.retryAfterMs ? ` Retry after ${spawnCheck.retryAfterMs}ms.` : "";
|
|
15108
|
-
console.warn(`[daemon] ⚠️ Spawn suppressed for chatroom=${event.chatroomId} role=${event.role} reason=${event.reason}.${retryMsg}`);
|
|
15099
|
+
console.warn(`[daemon] ⚠️ Spawn suppressed for chatroom=${event.chatroomId} role=${event.role} reason=${event.reason} (id: ${eventId}).${retryMsg}`);
|
|
15109
15100
|
return;
|
|
15110
15101
|
}
|
|
15102
|
+
console.log(`[daemon] Processing agent.requestStart (id: ${eventId})`);
|
|
15111
15103
|
await executeStartAgent(ctx, {
|
|
15112
15104
|
chatroomId: event.chatroomId,
|
|
15113
15105
|
role: event.role,
|
|
@@ -15196,6 +15188,7 @@ async function executeStopAgent(ctx, args) {
|
|
|
15196
15188
|
}
|
|
15197
15189
|
var init_stop_agent = __esm(() => {
|
|
15198
15190
|
init_api3();
|
|
15191
|
+
init_on_agent_shutdown();
|
|
15199
15192
|
init_shared();
|
|
15200
15193
|
});
|
|
15201
15194
|
|
|
@@ -15729,6 +15722,162 @@ var init_git_heartbeat = __esm(() => {
|
|
|
15729
15722
|
init_git_polling();
|
|
15730
15723
|
});
|
|
15731
15724
|
|
|
15725
|
+
// src/infrastructure/services/remote-agents/harness-restart-policy.ts
|
|
15726
|
+
class OpenCodeRestartPolicy {
|
|
15727
|
+
id = "opencode";
|
|
15728
|
+
shouldStartAgent(params) {
|
|
15729
|
+
const { task, agentConfig } = params;
|
|
15730
|
+
if (agentConfig.desiredState !== "running") {
|
|
15731
|
+
return false;
|
|
15732
|
+
}
|
|
15733
|
+
if (agentConfig.circuitState === "open") {
|
|
15734
|
+
return false;
|
|
15735
|
+
}
|
|
15736
|
+
if (task.status === "in_progress") {
|
|
15737
|
+
return agentConfig.spawnedAgentPid == null;
|
|
15738
|
+
}
|
|
15739
|
+
if (task.status === "pending" || task.status === "acknowledged") {
|
|
15740
|
+
return agentConfig.spawnedAgentPid == null;
|
|
15741
|
+
}
|
|
15742
|
+
return false;
|
|
15743
|
+
}
|
|
15744
|
+
}
|
|
15745
|
+
|
|
15746
|
+
class PiRestartPolicy {
|
|
15747
|
+
id = "pi";
|
|
15748
|
+
shouldStartAgent(params, context) {
|
|
15749
|
+
const { task, agentConfig } = params;
|
|
15750
|
+
if (agentConfig.desiredState !== "running") {
|
|
15751
|
+
return false;
|
|
15752
|
+
}
|
|
15753
|
+
if (agentConfig.circuitState === "open") {
|
|
15754
|
+
return false;
|
|
15755
|
+
}
|
|
15756
|
+
if (task.status === "in_progress") {
|
|
15757
|
+
return agentConfig.spawnedAgentPid == null;
|
|
15758
|
+
}
|
|
15759
|
+
if (task.status === "pending" || task.status === "acknowledged") {
|
|
15760
|
+
if (agentConfig.spawnedAgentPid == null) {
|
|
15761
|
+
return true;
|
|
15762
|
+
}
|
|
15763
|
+
}
|
|
15764
|
+
if (task.status !== "pending" && task.status !== "acknowledged") {
|
|
15765
|
+
return false;
|
|
15766
|
+
}
|
|
15767
|
+
if (!context?.pendingStops) {
|
|
15768
|
+
return false;
|
|
15769
|
+
}
|
|
15770
|
+
const key = `${task.chatroomId}:${agentConfig.role.toLowerCase()}`;
|
|
15771
|
+
const pendingReason = context.pendingStops.get(key);
|
|
15772
|
+
return pendingReason === "agent_process.turn_end";
|
|
15773
|
+
}
|
|
15774
|
+
}
|
|
15775
|
+
function getRestartPolicyForHarness(harness) {
|
|
15776
|
+
switch (harness) {
|
|
15777
|
+
case "opencode":
|
|
15778
|
+
return new OpenCodeRestartPolicy;
|
|
15779
|
+
case "pi":
|
|
15780
|
+
return new PiRestartPolicy;
|
|
15781
|
+
default:
|
|
15782
|
+
return {
|
|
15783
|
+
id: harness,
|
|
15784
|
+
shouldStartAgent: () => false
|
|
15785
|
+
};
|
|
15786
|
+
}
|
|
15787
|
+
}
|
|
15788
|
+
|
|
15789
|
+
// src/commands/machine/daemon-start/task-monitor.ts
|
|
15790
|
+
function canAttemptRestart(chatroomId, role, now) {
|
|
15791
|
+
const key = `${chatroomId}:${role.toLowerCase()}`;
|
|
15792
|
+
const lastAttempt = lastRestartAttempt.get(key) ?? 0;
|
|
15793
|
+
return now - lastAttempt >= RESTART_COOLDOWN_MS;
|
|
15794
|
+
}
|
|
15795
|
+
function recordRestartAttempt(chatroomId, role, now) {
|
|
15796
|
+
const key = `${chatroomId}:${role.toLowerCase()}`;
|
|
15797
|
+
lastRestartAttempt.set(key, now);
|
|
15798
|
+
}
|
|
15799
|
+
function startTaskMonitor(ctx) {
|
|
15800
|
+
let unsubscribe = null;
|
|
15801
|
+
let isRunning = true;
|
|
15802
|
+
const startMonitoring = async () => {
|
|
15803
|
+
try {
|
|
15804
|
+
const wsClient2 = await getConvexWsClient();
|
|
15805
|
+
const agentEndContext = {
|
|
15806
|
+
pendingStops: ctx.pendingStops
|
|
15807
|
+
};
|
|
15808
|
+
unsubscribe = wsClient2.onUpdate(api.machines.getAssignedTasks, {
|
|
15809
|
+
sessionId: ctx.sessionId,
|
|
15810
|
+
machineId: ctx.machineId
|
|
15811
|
+
}, async (result) => {
|
|
15812
|
+
if (!result?.tasks || result.tasks.length === 0)
|
|
15813
|
+
return;
|
|
15814
|
+
const now = Date.now();
|
|
15815
|
+
for (const taskInfo of result.tasks) {
|
|
15816
|
+
const { task, agentConfig } = {
|
|
15817
|
+
task: {
|
|
15818
|
+
taskId: taskInfo.taskId,
|
|
15819
|
+
chatroomId: taskInfo.chatroomId,
|
|
15820
|
+
status: taskInfo.status,
|
|
15821
|
+
assignedTo: taskInfo.assignedTo,
|
|
15822
|
+
updatedAt: taskInfo.updatedAt,
|
|
15823
|
+
createdAt: taskInfo.createdAt
|
|
15824
|
+
},
|
|
15825
|
+
agentConfig: taskInfo.agentConfig
|
|
15826
|
+
};
|
|
15827
|
+
const policy = getRestartPolicyForHarness(agentConfig.agentHarness);
|
|
15828
|
+
const shouldStart = policy.shouldStartAgent({ task, agentConfig }, agentEndContext);
|
|
15829
|
+
if (!shouldStart)
|
|
15830
|
+
continue;
|
|
15831
|
+
if (!canAttemptRestart(task.chatroomId, agentConfig.role, now)) {
|
|
15832
|
+
continue;
|
|
15833
|
+
}
|
|
15834
|
+
if (!agentConfig.workingDir) {
|
|
15835
|
+
console.warn(`[${formatTimestamp()}] ⚠️ Missing workingDir for ${task.chatroomId}/${agentConfig.role}` + ` — skipping`);
|
|
15836
|
+
continue;
|
|
15837
|
+
}
|
|
15838
|
+
console.log(`[${formatTimestamp()}] \uD83D\uDCE1 Task monitor: starting agent for ` + `${task.chatroomId}/${agentConfig.role} (harness: ${agentConfig.agentHarness})`);
|
|
15839
|
+
recordRestartAttempt(task.chatroomId, agentConfig.role, now);
|
|
15840
|
+
try {
|
|
15841
|
+
await executeStartAgent(ctx, {
|
|
15842
|
+
chatroomId: task.chatroomId,
|
|
15843
|
+
role: agentConfig.role,
|
|
15844
|
+
agentHarness: agentConfig.agentHarness,
|
|
15845
|
+
model: agentConfig.model,
|
|
15846
|
+
workingDir: agentConfig.workingDir,
|
|
15847
|
+
reason: "daemon.task_monitor"
|
|
15848
|
+
});
|
|
15849
|
+
} catch (err) {
|
|
15850
|
+
console.error(`[${formatTimestamp()}] ❌ Task monitor failed to start agent ` + `for ${task.chatroomId}/${agentConfig.role}: ${err.message}`);
|
|
15851
|
+
}
|
|
15852
|
+
}
|
|
15853
|
+
});
|
|
15854
|
+
console.log(`[${formatTimestamp()}] \uD83D\uDD0D Task monitor started`);
|
|
15855
|
+
} catch (err) {
|
|
15856
|
+
if (isRunning) {
|
|
15857
|
+
console.error(`[${formatTimestamp()}] ❌ Task monitor error: ${err.message}`);
|
|
15858
|
+
setTimeout(startMonitoring, 5000);
|
|
15859
|
+
}
|
|
15860
|
+
}
|
|
15861
|
+
};
|
|
15862
|
+
startMonitoring();
|
|
15863
|
+
return {
|
|
15864
|
+
stop: () => {
|
|
15865
|
+
isRunning = false;
|
|
15866
|
+
if (unsubscribe) {
|
|
15867
|
+
unsubscribe();
|
|
15868
|
+
unsubscribe = null;
|
|
15869
|
+
}
|
|
15870
|
+
}
|
|
15871
|
+
};
|
|
15872
|
+
}
|
|
15873
|
+
var RESTART_COOLDOWN_MS = 60000, lastRestartAttempt;
|
|
15874
|
+
var init_task_monitor = __esm(() => {
|
|
15875
|
+
init_api3();
|
|
15876
|
+
init_client2();
|
|
15877
|
+
init_start_agent();
|
|
15878
|
+
lastRestartAttempt = new Map;
|
|
15879
|
+
});
|
|
15880
|
+
|
|
15732
15881
|
// src/commands/machine/daemon-start/command-loop.ts
|
|
15733
15882
|
async function refreshModels(ctx) {
|
|
15734
15883
|
if (!ctx.config)
|
|
@@ -15816,12 +15965,14 @@ async function startCommandLoop(ctx) {
|
|
|
15816
15965
|
}, DAEMON_HEARTBEAT_INTERVAL_MS);
|
|
15817
15966
|
heartbeatTimer.unref();
|
|
15818
15967
|
const gitPollingHandle = startGitPollingLoop(ctx);
|
|
15968
|
+
const taskMonitorHandle = startTaskMonitor(ctx);
|
|
15819
15969
|
pushGitState(ctx).catch(() => {});
|
|
15820
15970
|
const shutdown = async () => {
|
|
15821
15971
|
console.log(`
|
|
15822
15972
|
[${formatTimestamp()}] Shutting down...`);
|
|
15823
15973
|
clearInterval(heartbeatTimer);
|
|
15824
15974
|
gitPollingHandle.stop();
|
|
15975
|
+
taskMonitorHandle.stop();
|
|
15825
15976
|
await onDaemonShutdown(ctx);
|
|
15826
15977
|
releaseLock();
|
|
15827
15978
|
process.exit(0);
|
|
@@ -15846,7 +15997,7 @@ Listening for commands...`);
|
|
|
15846
15997
|
evictStaleDedupEntries(processedCommandIds, processedPingIds, processedGitRefreshIds);
|
|
15847
15998
|
for (const event of result.events) {
|
|
15848
15999
|
try {
|
|
15849
|
-
console.log(`[${formatTimestamp()}] \uD83D\uDCE1 Stream command event: ${event.type}`);
|
|
16000
|
+
console.log(`[${formatTimestamp()}] \uD83D\uDCE1 Stream command event: ${event.type} (id: ${event._id})`);
|
|
15850
16001
|
await dispatchCommandEvent(ctx, event, processedCommandIds, processedPingIds, processedGitRefreshIds);
|
|
15851
16002
|
} catch (err) {
|
|
15852
16003
|
console.error(`[${formatTimestamp()}] ❌ Stream command event failed: ${err.message}`);
|
|
@@ -15873,6 +16024,7 @@ var init_command_loop = __esm(() => {
|
|
|
15873
16024
|
init_pid();
|
|
15874
16025
|
init_git_polling();
|
|
15875
16026
|
init_git_heartbeat();
|
|
16027
|
+
init_task_monitor();
|
|
15876
16028
|
MODEL_REFRESH_INTERVAL_MS = 5 * 60 * 1000;
|
|
15877
16029
|
});
|
|
15878
16030
|
|