Files
openclaw/src/gateway/server-methods/diagnostics.ts
Gustavo Madeira Santana 28818f9140 Improve gateway diagnostics export for support reports (#70324)
Merged via squash.

Prepared head SHA: 3d6ee85993
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Reviewed-by: @gumadeiras
2026-04-22 20:47:14 -04:00

25 lines
763 B
TypeScript

import {
getDiagnosticStabilitySnapshot,
normalizeDiagnosticStabilityQuery,
} from "../../logging/diagnostic-stability.js";
import { ErrorCodes, errorShape } from "../protocol/index.js";
import type { GatewayRequestHandlers } from "./types.js";
export const diagnosticsHandlers: GatewayRequestHandlers = {
"diagnostics.stability": async ({ params, respond }) => {
try {
const query = normalizeDiagnosticStabilityQuery(params);
respond(true, getDiagnosticStabilitySnapshot(query), undefined);
} catch (err) {
respond(
false,
undefined,
errorShape(
ErrorCodes.INVALID_REQUEST,
err instanceof Error ? err.message : "invalid diagnostics.stability params",
),
);
}
},
};