fix: 收敛 commander supervisor 噪声
This commit is contained in:
+6
-1
@@ -97,7 +97,8 @@ function livenessSnapshot(run: RunRecord, command: CommandRecord | null, events:
|
||||
const active = terminal === null && !runIsTerminal(run) && !commandIsTerminal(command);
|
||||
const lastEvent = events.at(-1) ?? null;
|
||||
const lastVisibleActivity = latestVisibleActivity(scopedEvents);
|
||||
const lastCommandActivity = lastVisibleActivity ?? latestLivenessActivity(scopedEvents);
|
||||
const lastBusinessActivity = latestBusinessActivity(scopedEvents);
|
||||
const lastCommandActivity = lastBusinessActivity ?? latestLivenessActivity(scopedEvents);
|
||||
const lease = leaseSummary(run, nowMs);
|
||||
const transportDisconnect = latestTransportDisconnect(scopedEvents);
|
||||
const lastActivity = livenessActivitySummary(lastCommandActivity, nowMs);
|
||||
@@ -193,6 +194,10 @@ function latestVisibleActivity(events: RunEvent[]): RunEvent | null {
|
||||
return [...events].reverse().find((event) => event.type === "assistant_message" || event.type === "tool_call" || event.type === "command_output" || event.type === "diff" || event.type === "error" || event.type === "terminal_status") ?? null;
|
||||
}
|
||||
|
||||
function latestBusinessActivity(events: RunEvent[]): RunEvent | null {
|
||||
return [...events].reverse().find((event) => event.type === "assistant_message" || event.type === "tool_call" || event.type === "command_output" || event.type === "diff") ?? null;
|
||||
}
|
||||
|
||||
function isLivenessActivityEvent(event: RunEvent): boolean {
|
||||
if (event.type === "assistant_message" || event.type === "tool_call" || event.type === "command_output" || event.type === "diff" || event.type === "error" || event.type === "terminal_status") return true;
|
||||
if (event.type !== "backend_status") return false;
|
||||
|
||||
Reference in New Issue
Block a user