fix: 收敛 commander supervisor 噪声

This commit is contained in:
Codex
2026-06-10 12:14:31 +08:00
parent 90aab17146
commit 04afc05f95
3 changed files with 16 additions and 5 deletions
+6 -1
View File
@@ -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;