11// Implements `openclaw channels status` with gateway status and config-only fallback.
22import { redactSensitiveUrlLikeString } from "@openclaw/net-policy/redact-sensitive-url" ;
3+ import { normalizeOptionalLowercaseString } from "@openclaw/normalization-core/string-coerce" ;
34import { parseTimeoutMsWithFallback } from "../../cli/parse-timeout.js" ;
45import { withProgress } from "../../cli/progress.js" ;
56import { callGateway } from "../../gateway/call.js" ;
@@ -32,6 +33,10 @@ export async function channelsStatusCommand(
3233 opts : ChannelsStatusOptions ,
3334 runtime : RuntimeEnv = defaultRuntime ,
3435) {
36+ const args =
37+ normalizeOptionalLowercaseString ( opts . channel ) === "all"
38+ ? { ...opts , channel : undefined }
39+ : opts ;
3540 const timeoutMs = parseTimeoutMsWithFallback ( opts . timeout , opts . probe ? 30_000 : 10_000 , {
3641 invalidType : "error" ,
3742 } ) ;
@@ -52,8 +57,8 @@ export async function channelsStatusCommand(
5257 probe : Boolean ( opts . probe ) ,
5358 timeoutMs,
5459 } ;
55- if ( opts . channel ) {
56- params . channel = opts . channel ;
60+ if ( args . channel ) {
61+ params . channel = args . channel ;
5762 }
5863 return await callGateway ( {
5964 method : "channels.status" ,
@@ -72,6 +77,6 @@ export async function channelsStatusCommand(
7277 const safeError = formatChannelsStatusError ( err ) ;
7378 const gatewayAuthUnavailable = isGatewaySecretRefUnavailableError ( err ) ;
7479 const { renderChannelsStatusFallback } = await loadChannelsStatusRuntime ( ) ;
75- await renderChannelsStatusFallback ( { opts, runtime, safeError, gatewayAuthUnavailable } ) ;
80+ await renderChannelsStatusFallback ( { opts : args , runtime, safeError, gatewayAuthUnavailable } ) ;
7681 }
7782}
0 commit comments