Skip to content

Commit e7a1837

Browse files
committed
fix: speed up status json channel detection
Signed-off-by: sallyom <[email protected]>
1 parent 8fc53e7 commit e7a1837

4 files changed

Lines changed: 24 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ Docs: https://docs.openclaw.ai
176176
- Gateway/macOS: `openclaw gateway stop` now uses `launchctl bootout` by default instead of unconditionally calling `launchctl disable`, so KeepAlive auto-recovery still works after unexpected crashes; use the new `--disable` flag to opt into the persistent-disable behavior when a manual stop should survive reboots. Fixes #77934. Thanks @bmoran1022.
177177
- Gateway/macOS: `repairLaunchAgentBootstrap` no longer kickstarts an already-running LaunchAgent, preventing unnecessary service restarts and session disconnects when repair runs against a healthy gateway. Fixes #77428. Thanks @ramitrkar-hash.
178178
- Gateway/macOS: `openclaw gateway stop --disable` now persists the LaunchAgent disable bit even after a previous bootout left the service not loaded, keeping the explicit stay-down path reliable. (#78412) Thanks @wdeveloper16.
179+
- CLI/status: keep lean `openclaw status --json` off manifest-backed channel discovery so configured-channel checks do not repeatedly rescan plugin metadata. Fixes #79129.
179180
- Control UI/chat: hide retired and non-public Google Gemini model IDs from chat model catalogs and route the bare `gemini-3-pro` alias to Gemini 3.1 Pro Preview instead of the shut-down Gemini 3 Pro Preview. Thanks @BunsDev.
180181
- CLI/install: refuse state-mutating OpenClaw CLI runs as root by default, keep an explicit `OPENCLAW_ALLOW_ROOT=1` escape hatch for intentional root/container use, and update DigitalOcean setup guidance to run OpenClaw as a non-root user. Fixes #67478. Thanks @Jerry-Xin and @natechicago.
181182
- Gateway/watch: leave `OPENCLAW_TRACE_SYNC_IO` disabled by default in `pnpm gateway:watch:raw` so watch mode avoids noisy Node sync-I/O stack traces unless explicitly requested.

src/commands/status.scan.fast-json.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ describe("scanStatusJsonFast", () => {
5555

5656
await scanStatusJsonFast({}, {} as never);
5757

58+
expect(mocks.hasConfiguredChannelsForReadOnlyScope).not.toHaveBeenCalled();
5859
expect(mocks.ensurePluginRegistryLoaded).not.toHaveBeenCalled();
5960
expect(loggingStateRef.forceConsoleToStderr).toBe(false);
6061
});

src/commands/status.scan.fast-json.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { hasPotentialConfiguredChannels } from "../channels/config-presence.js";
12
import type { OpenClawConfig } from "../config/types.js";
2-
import { hasConfiguredChannelsForReadOnlyScope } from "../plugins/channel-plugin-ids.js";
33
import type { RuntimeEnv } from "../runtime.js";
44
import { executeStatusScanFromOverview } from "./status.scan-execute.ts";
55
import {
@@ -58,11 +58,8 @@ export async function scanStatusJsonFast(
5858
commandName: "status --json",
5959
allowMissingConfigFastPath: true,
6060
includeChannelSummary: false,
61-
resolveHasConfiguredChannels: (cfg, sourceConfig) =>
62-
hasConfiguredChannelsForReadOnlyScope({
63-
config: cfg,
64-
activationSourceConfig: sourceConfig,
65-
env: process.env,
61+
resolveHasConfiguredChannels: (cfg) =>
62+
hasPotentialConfiguredChannels(cfg, process.env, {
6663
includePersistedAuthState: false,
6764
}),
6865
resolveMemory: async ({ cfg, agentStatus, memoryPlugin }) =>

src/commands/status.scan.test-helpers.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ type ResolveConfigPathMock = Mock<() => string>;
88
type StatusScanSharedMocks = {
99
resolveConfigPath: ResolveConfigPathMock;
1010
hasPotentialConfiguredChannels: UnknownMock;
11+
hasConfiguredChannelsForReadOnlyScope: UnknownMock;
1112
readBestEffortConfig: UnknownMock;
1213
resolveCommandSecretRefsViaGateway: UnknownMock;
1314
getUpdateCheckResult: UnknownMock;
@@ -26,6 +27,7 @@ export function createStatusScanSharedMocks(configPathLabel: string): StatusScan
2627
return {
2728
resolveConfigPath: vi.fn(() => `/tmp/openclaw-${configPathLabel}-missing-${process.pid}.json`),
2829
hasPotentialConfiguredChannels: vi.fn(),
30+
hasConfiguredChannelsForReadOnlyScope: vi.fn(),
2931
readBestEffortConfig: vi.fn(),
3032
resolveCommandSecretRefsViaGateway: vi.fn(),
3133
getUpdateCheckResult: vi.fn(),
@@ -187,16 +189,7 @@ export async function loadStatusScanModuleForTest(
187189
config: OpenClawConfig;
188190
env?: NodeJS.ProcessEnv;
189191
includePersistedAuthState?: boolean;
190-
}) =>
191-
Boolean(
192-
mocks.hasPotentialConfiguredChannels(
193-
params.config,
194-
params.env,
195-
params.includePersistedAuthState === undefined
196-
? undefined
197-
: { includePersistedAuthState: params.includePersistedAuthState },
198-
),
199-
),
192+
}) => mocks.hasConfiguredChannelsForReadOnlyScope(params),
200193
listConfiguredChannelIdsForReadOnlyScope: (params: {
201194
config: OpenClawConfig;
202195
env?: NodeJS.ProcessEnv;
@@ -409,6 +402,22 @@ export function applyStatusScanDefaults(
409402
const resolvedConfig = options.resolvedConfig ?? sourceConfig;
410403

411404
mocks.hasPotentialConfiguredChannels.mockReturnValue(options.hasConfiguredChannels ?? false);
405+
mocks.hasConfiguredChannelsForReadOnlyScope.mockImplementation((rawParams: unknown) => {
406+
const params = rawParams as {
407+
config: OpenClawConfig;
408+
env?: NodeJS.ProcessEnv;
409+
includePersistedAuthState?: boolean;
410+
};
411+
return Boolean(
412+
mocks.hasPotentialConfiguredChannels(
413+
params.config,
414+
params.env,
415+
params.includePersistedAuthState === undefined
416+
? undefined
417+
: { includePersistedAuthState: params.includePersistedAuthState },
418+
),
419+
);
420+
});
412421
mocks.readBestEffortConfig.mockResolvedValue(sourceConfig);
413422
mocks.resolveCommandSecretRefsViaGateway.mockResolvedValue({
414423
resolvedConfig,

0 commit comments

Comments
 (0)