@linzumi/cli 0.0.103-beta → 0.0.104-beta
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/README.md +1 -1
- package/dist/index.js +40 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.js
CHANGED
|
@@ -19948,7 +19948,7 @@ var linzumiCliVersion, linzumiCliVersionText;
|
|
|
19948
19948
|
var init_version = __esm({
|
|
19949
19949
|
"src/version.ts"() {
|
|
19950
19950
|
"use strict";
|
|
19951
|
-
linzumiCliVersion = "0.0.
|
|
19951
|
+
linzumiCliVersion = "0.0.104-beta";
|
|
19952
19952
|
linzumiCliVersionText = `linzumi ${linzumiCliVersion}`;
|
|
19953
19953
|
}
|
|
19954
19954
|
});
|
|
@@ -25827,6 +25827,32 @@ async function openLocalCodexRunner(options, log2, cleanup, close) {
|
|
|
25827
25827
|
});
|
|
25828
25828
|
}
|
|
25829
25829
|
if (control.type === "start_instance") {
|
|
25830
|
+
if (shouldSkipReplayedStartInstanceForKnownSession(
|
|
25831
|
+
control,
|
|
25832
|
+
(kandanThreadId) => threadSessionRegistry.list().some((record) => record.kandanThreadId === kandanThreadId)
|
|
25833
|
+
)) {
|
|
25834
|
+
skippedStaleStartInstances += 1;
|
|
25835
|
+
log2("kandan.start_instance_skipped_known_session", {
|
|
25836
|
+
threadId: controlThreadId(control) ?? null,
|
|
25837
|
+
controlSeq: control.control_seq ?? null,
|
|
25838
|
+
issuedAt: controlIssuedAt(control) ?? null,
|
|
25839
|
+
reason: "thread_already_has_known_session",
|
|
25840
|
+
skippedStaleStartInstances
|
|
25841
|
+
});
|
|
25842
|
+
return kandan.push(topic, "codex_response", {
|
|
25843
|
+
instanceId,
|
|
25844
|
+
controlType: control.type,
|
|
25845
|
+
threadId: controlThreadId(control) ?? null,
|
|
25846
|
+
ok: false,
|
|
25847
|
+
skipped: true,
|
|
25848
|
+
error: "start_instance_thread_already_has_session",
|
|
25849
|
+
issuedAt: controlIssuedAt(control) ?? null
|
|
25850
|
+
}).catch((error) => {
|
|
25851
|
+
log2("kandan.control_response_push_failed", {
|
|
25852
|
+
message: error instanceof Error ? error.message : String(error)
|
|
25853
|
+
});
|
|
25854
|
+
});
|
|
25855
|
+
}
|
|
25830
25856
|
const staleAgeMs = staleStartInstanceAgeMs(control, Date.now());
|
|
25831
25857
|
if (staleAgeMs !== void 0) {
|
|
25832
25858
|
skippedStaleStartInstances += 1;
|
|
@@ -26003,6 +26029,19 @@ function staleStartInstanceAgeMs(control, nowMs) {
|
|
|
26003
26029
|
const ageMs = nowMs - issuedAtMs;
|
|
26004
26030
|
return ageMs > staleStartInstanceWindowMs ? ageMs : void 0;
|
|
26005
26031
|
}
|
|
26032
|
+
function shouldSkipReplayedStartInstanceForKnownSession(control, hasKnownThreadSession) {
|
|
26033
|
+
if (control.type !== "start_instance") {
|
|
26034
|
+
return false;
|
|
26035
|
+
}
|
|
26036
|
+
if (!controlReplayed(control)) {
|
|
26037
|
+
return false;
|
|
26038
|
+
}
|
|
26039
|
+
const kandanThreadId = controlThreadId(control);
|
|
26040
|
+
if (kandanThreadId === void 0) {
|
|
26041
|
+
return false;
|
|
26042
|
+
}
|
|
26043
|
+
return hasKnownThreadSession(kandanThreadId);
|
|
26044
|
+
}
|
|
26006
26045
|
function shouldSkipReplayedStartTurn(appliedControlSeq, controlSeq) {
|
|
26007
26046
|
return appliedControlSeq !== void 0 && controlSeq <= appliedControlSeq;
|
|
26008
26047
|
}
|
package/package.json
CHANGED