mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-24 00:11:31 +00:00
Status: skip unused channel issue scan in JSON mode
This commit is contained in:
@@ -4,6 +4,7 @@ const mocks = vi.hoisted(() => ({
|
||||
readBestEffortConfig: vi.fn(),
|
||||
resolveCommandSecretRefsViaGateway: vi.fn(),
|
||||
buildChannelsTable: vi.fn(),
|
||||
callGateway: vi.fn(),
|
||||
getUpdateCheckResult: vi.fn(),
|
||||
getAgentLocalStatuses: vi.fn(),
|
||||
getStatusSummary: vi.fn(),
|
||||
@@ -51,7 +52,7 @@ vi.mock("../infra/tailscale.js", () => ({
|
||||
|
||||
vi.mock("../gateway/call.js", () => ({
|
||||
buildGatewayConnectionDetails: mocks.buildGatewayConnectionDetails,
|
||||
callGateway: vi.fn(),
|
||||
callGateway: mocks.callGateway,
|
||||
}));
|
||||
|
||||
vi.mock("../gateway/probe.js", () => ({
|
||||
@@ -245,6 +246,9 @@ describe("scanStatus", () => {
|
||||
await scanStatus({ json: true }, {} as never);
|
||||
|
||||
expect(mocks.ensurePluginRegistryLoaded).toHaveBeenCalledWith({ scope: "channels" });
|
||||
expect(mocks.callGateway).not.toHaveBeenCalledWith(
|
||||
expect.objectContaining({ method: "channels.status" }),
|
||||
);
|
||||
});
|
||||
|
||||
it("preloads channel plugins for status --json when channel auth is env-only", async () => {
|
||||
|
||||
@@ -247,11 +247,9 @@ async function scanStatusJsonFast(opts: {
|
||||
const gatewaySelf = gatewayProbe?.presence
|
||||
? pickGatewaySelfPresence(gatewayProbe.presence)
|
||||
: null;
|
||||
const channelsStatusPromise = resolveChannelsStatus({ cfg, gatewayReachable, opts });
|
||||
const memoryPlugin = resolveMemoryPluginStatus(cfg);
|
||||
const memoryPromise = resolveMemoryStatusSnapshot({ cfg, agentStatus, memoryPlugin });
|
||||
const [channelsStatus, memory] = await Promise.all([channelsStatusPromise, memoryPromise]);
|
||||
const channelIssues = channelsStatus ? collectChannelStatusIssues(channelsStatus) : [];
|
||||
const memory = await memoryPromise;
|
||||
|
||||
return {
|
||||
cfg,
|
||||
@@ -270,7 +268,7 @@ async function scanStatusJsonFast(opts: {
|
||||
gatewayProbe,
|
||||
gatewayReachable,
|
||||
gatewaySelf,
|
||||
channelIssues,
|
||||
channelIssues: [],
|
||||
agentStatus,
|
||||
channels: { rows: [], details: [] },
|
||||
summary,
|
||||
|
||||
Reference in New Issue
Block a user