





















@@ -16,6 +16,7 @@ import { normalizeOptionalString } from "../shared/string-coerce.js";
1616import { sanitizeForLog } from "../terminal/ansi.js";
1717import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../utils/message-channel.js";
1818import { formatCliCommand } from "./command-format.js";
19+import { formatUnsupportedChannelActionMessage } from "./error-format.js";
1920import { commitConfigWithPendingPluginInstalls } from "./plugins-install-record-commit.js";
20212122type ChannelAuthOptions = {
@@ -118,7 +119,11 @@ async function resolveChannelPluginForMode(
118119const plugin = resolved.plugin;
119120if (!plugin || !supportsChannelAuthMode(plugin, mode)) {
120121throw new Error(
121-`Channel "${channelId}" does not support ${mode}. Run ${formatCliCommand("openclaw channels status --channel " + channelId)} for its supported actions.`,
122+formatUnsupportedChannelActionMessage({
123+channel: channelId,
124+action: mode,
125+inspectCommand: "openclaw channels status --channel " + channelId,
126+}),
122127);
123128}
124129return {
@@ -227,7 +232,13 @@ export async function runChannelLogin(
227232}
228233const login = plugin.auth?.login;
229234if (!login) {
230-throw new Error(`Channel "${channelInput}" does not support login.`);
235+throw new Error(
236+formatUnsupportedChannelActionMessage({
237+channel: channelInput,
238+action: "login",
239+inspectCommand: "openclaw channels status --channel " + channelInput,
240+}),
241+);
231242}
232243// Auth-only flow: do not mutate channel config here.
233244setVerbose(Boolean(opts.verbose));
@@ -270,7 +281,13 @@ export async function runChannelLogout(
270281}
271282const logoutAccount = plugin.gateway?.logoutAccount;
272283if (!logoutAccount) {
273-throw new Error(`Channel "${channelInput}" does not support logout.`);
284+throw new Error(
285+formatUnsupportedChannelActionMessage({
286+channel: channelInput,
287+action: "logout",
288+inspectCommand: "openclaw channels status --channel " + channelInput,
289+}),
290+);
274291}
275292// Prefer the live gateway so logout also stops any active channel runtime.
276293const { accountId } = resolveAccountContext(plugin, opts, cfg);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。