@vibe-lark/larkpal 0.1.66 → 0.1.67
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/main.mjs +7 -2
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -3774,6 +3774,7 @@ function serializeChatRun(run) {
|
|
|
3774
3774
|
lastToolName: run.lastToolName,
|
|
3775
3775
|
idleSeconds,
|
|
3776
3776
|
adapterBusy: run.status === "running" ? run.adapterBusy : false,
|
|
3777
|
+
processStatus: run.processStatus,
|
|
3777
3778
|
staleReason: run.staleReason
|
|
3778
3779
|
};
|
|
3779
3780
|
}
|
|
@@ -3922,10 +3923,14 @@ async function reconcileRunWithAdapter(run, messageStore, processManager) {
|
|
|
3922
3923
|
const processInfo = processManager.getProcessInfo(run.sessionId);
|
|
3923
3924
|
const adapterBusy = processManager.isSessionBusy?.(run.sessionId) ?? processInfo?.status === "running";
|
|
3924
3925
|
run.adapterBusy = adapterBusy;
|
|
3926
|
+
run.processStatus = processInfo?.status;
|
|
3925
3927
|
const idleMs = Date.now() - run.lastEventAt;
|
|
3926
3928
|
let staleReason;
|
|
3927
|
-
if (!adapterBusy)
|
|
3928
|
-
|
|
3929
|
+
if (!adapterBusy) {
|
|
3930
|
+
if (!processInfo) staleReason = "runtime adapter reports session is not busy";
|
|
3931
|
+
else if (processInfo.status === "stopped" || processInfo.status === "crashed" || processInfo.status === "stopping") staleReason = `runtime process is ${processInfo.status}`;
|
|
3932
|
+
else if (idleMs >= getStaleRunIdleMs()) staleReason = `run idle for ${Math.floor(idleMs / 1e3)}s while runtime process is ${processInfo.status}`;
|
|
3933
|
+
} else if (idleMs >= getStaleRunIdleMs()) staleReason = `run idle for ${Math.floor(idleMs / 1e3)}s`;
|
|
3929
3934
|
if (!staleReason) return;
|
|
3930
3935
|
let cleanupRequired = false;
|
|
3931
3936
|
if (!adapterBusy && (processInfo?.status === "running" || processInfo?.status === "starting")) {
|