mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 05:30:42 +00:00
fix(lint): cover diagnostic phase events
This commit is contained in:
@@ -2222,6 +2222,8 @@ export function createDiagnosticsOtelService(): OpenClawPluginService {
|
||||
case "diagnostic.liveness.warning":
|
||||
recordLivenessWarning(evt);
|
||||
return;
|
||||
case "diagnostic.phase.completed":
|
||||
return;
|
||||
case "run.started":
|
||||
recordRunStarted(evt, metadata);
|
||||
return;
|
||||
|
||||
@@ -39,7 +39,7 @@ export function getCurrentDiagnosticPhase(): string | undefined {
|
||||
}
|
||||
|
||||
export function getRecentDiagnosticPhases(limit = 8): DiagnosticPhaseSnapshot[] {
|
||||
return recentPhases.slice(-Math.max(0, limit)).map((phase) => ({ ...phase }));
|
||||
return recentPhases.slice(-Math.max(0, limit)).map((phase) => Object.assign({}, phase));
|
||||
}
|
||||
|
||||
export function recordDiagnosticPhase(snapshot: DiagnosticPhaseSnapshot): void {
|
||||
|
||||
@@ -397,7 +397,7 @@ describe("stuck session diagnostics threshold", () => {
|
||||
}
|
||||
|
||||
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining("terminalProgressStale=true"));
|
||||
expect(events.filter((event) => event.type === "session.stalled").at(-1)).toMatchObject({
|
||||
expect(events.findLast((event) => event.type === "session.stalled")).toMatchObject({
|
||||
terminalProgressStale: true,
|
||||
lastProgressReason: "codex_app_server:notification:rawResponseItem/completed",
|
||||
});
|
||||
@@ -754,9 +754,7 @@ describe("stuck session diagnostics threshold", () => {
|
||||
|
||||
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining("phase=startup.plugins.load"));
|
||||
expect(warnSpy).toHaveBeenCalledWith(expect.stringContaining("work=[queued=main("));
|
||||
expect(
|
||||
events.filter((event) => event.type === "diagnostic.liveness.warning").at(-1),
|
||||
).toMatchObject({
|
||||
expect(events.findLast((event) => event.type === "diagnostic.liveness.warning")).toMatchObject({
|
||||
phase: "startup.plugins.load",
|
||||
queuedWorkLabels: [expect.stringContaining("main(")],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user