@clawos-dev/clawd 0.2.635 → 0.2.637
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/cli.cjs +15 -3
- package/dist/cloud-persona-metrics.html +31 -31
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -46654,6 +46654,7 @@ function cloneState(s2) {
|
|
|
46654
46654
|
bufferStartSeq: s2.bufferStartSeq,
|
|
46655
46655
|
turnOpen: s2.turnOpen,
|
|
46656
46656
|
turnStartedAt: s2.turnStartedAt,
|
|
46657
|
+
turnSelfWoke: s2.turnSelfWoke,
|
|
46657
46658
|
pendingPermissions: s2.pendingPermissions,
|
|
46658
46659
|
pendingQuestions: s2.pendingQuestions,
|
|
46659
46660
|
freshSpawn: s2.freshSpawn,
|
|
@@ -47049,7 +47050,7 @@ function pushEventToBufferInPlace(next, event, deps) {
|
|
|
47049
47050
|
next.pendingBgTasks = [...pending, bg.agentId];
|
|
47050
47051
|
}
|
|
47051
47052
|
}
|
|
47052
|
-
if (isTurnEnd && next.turnOpen && isLateTurnEnd(withSeq, next.turnStartedAt, deps.now())) {
|
|
47053
|
+
if (isTurnEnd && next.turnOpen && !next.turnSelfWoke && isLateTurnEnd(withSeq, next.turnStartedAt, deps.now())) {
|
|
47053
47054
|
return [emitSessionEvent(next.file.sessionId, withSeq)];
|
|
47054
47055
|
}
|
|
47055
47056
|
if (isTurnEnd) {
|
|
@@ -47062,6 +47063,7 @@ function pushEventToBufferInPlace(next, event, deps) {
|
|
|
47062
47063
|
} else if (!isBackgroundEvent && !(isSessionInit && next.status === "running-idle") && !next.turnOpen) {
|
|
47063
47064
|
next.turnOpen = true;
|
|
47064
47065
|
next.turnStartedAt = deps.now();
|
|
47066
|
+
next.turnSelfWoke = next.status === "running-idle";
|
|
47065
47067
|
}
|
|
47066
47068
|
if (!next.turnOpen && next.buffer.length > deps.bufferCap) {
|
|
47067
47069
|
const remove = next.buffer.length - deps.bufferCap;
|
|
@@ -52941,6 +52943,11 @@ var CodexSubagentTracker = class {
|
|
|
52941
52943
|
}
|
|
52942
52944
|
return [];
|
|
52943
52945
|
}
|
|
52946
|
+
/** 还有子 agent 已开始、未到终态(completed / failed)。云上热 Pod 据此判断主线程轮末后是否仍在忙 */
|
|
52947
|
+
hasRunning() {
|
|
52948
|
+
for (const state of this.agents.values()) if (state.status && !state.terminal) return true;
|
|
52949
|
+
return false;
|
|
52950
|
+
}
|
|
52944
52951
|
handleActivity(item) {
|
|
52945
52952
|
const agentId = stringValue(item.agentThreadId);
|
|
52946
52953
|
if (!agentId) return [];
|
|
@@ -53247,6 +53254,7 @@ function driveCodexThread(opts) {
|
|
|
53247
53254
|
const firstByte = createFirstByteClock(opts.now);
|
|
53248
53255
|
const approvalIds = /* @__PURE__ */ new Map();
|
|
53249
53256
|
const subagents = new CodexSubagentTracker();
|
|
53257
|
+
let subagentsRunning = false;
|
|
53250
53258
|
const effort = ctx.effort;
|
|
53251
53259
|
let exited = false;
|
|
53252
53260
|
const finish = (code) => {
|
|
@@ -53280,6 +53288,10 @@ function driveCodexThread(opts) {
|
|
|
53280
53288
|
if (turnOpen) firstByte.see(events);
|
|
53281
53289
|
sink.pushEvents(events);
|
|
53282
53290
|
}
|
|
53291
|
+
if (subagents.hasRunning() !== subagentsRunning) {
|
|
53292
|
+
subagentsRunning = !subagentsRunning;
|
|
53293
|
+
if (!subagentsRunning) opts.onSubagentsIdle?.();
|
|
53294
|
+
}
|
|
53283
53295
|
if (route === "foreground" && method === "turn/completed") {
|
|
53284
53296
|
turnOpen = false;
|
|
53285
53297
|
opts.onTurnCompleted?.(turnOutcomeOf(params), firstByte.afterFirstByteMs());
|
|
@@ -53379,7 +53391,7 @@ function driveCodexThread(opts) {
|
|
|
53379
53391
|
opts.kill(signal);
|
|
53380
53392
|
}
|
|
53381
53393
|
};
|
|
53382
|
-
return { session, finish, client };
|
|
53394
|
+
return { session, finish, client, subagentsRunning: () => subagents.hasRunning() };
|
|
53383
53395
|
}
|
|
53384
53396
|
function record2(value) {
|
|
53385
53397
|
return value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -73730,7 +73742,7 @@ function computeMethodAccess(args) {
|
|
|
73730
73742
|
}
|
|
73731
73743
|
|
|
73732
73744
|
// src/version.ts
|
|
73733
|
-
var version = "0.2.
|
|
73745
|
+
var version = "0.2.637".length > 0 ? "0.2.637" : "dev";
|
|
73734
73746
|
|
|
73735
73747
|
// src/cli-probe/probe.ts
|
|
73736
73748
|
var fs84 = __toESM(require("fs"), 1);
|