惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
腾讯CDC
J
Java Code Geeks
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
博客园 - Franky
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
云风的 BLOG
云风的 BLOG
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
雷峰网
雷峰网
B
Blog RSS Feed
博客园_首页
量子位
F
Fortinet All Blogs
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Check Point Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(channels): prefer runtime status in channel list (#82...
steipete · 2026-05-15 · via Recent Commits to openclaw:main

@@ -5,6 +5,7 @@ import { listReadOnlyChannelPluginsForConfig } from "../../channels/plugins/read

55

import { buildChannelAccountSnapshot } from "../../channels/plugins/status.js";

66

import type { ChannelPlugin } from "../../channels/plugins/types.plugin.js";

77

import type { ChannelAccountSnapshot } from "../../channels/plugins/types.public.js";

8+

import { callGateway } from "../../gateway/call.js";

89

import { defaultRuntime, type RuntimeEnv, writeRuntimeJson } from "../../runtime.js";

910

import { formatDocsLink } from "../../terminal/links.js";

1011

import { theme } from "../../terminal/theme.js";

@@ -17,6 +18,47 @@ export type ChannelsListOptions = {

1718

all?: boolean;

1819

};

192021+

type RuntimeChannelStatus = {

22+

channelAccounts?: Record<string, unknown>;

23+

};

24+25+

function normalizeRuntimeAccounts(

26+

payload: RuntimeChannelStatus | null,

27+

): Map<string, ChannelAccountSnapshot[]> {

28+

const out = new Map<string, ChannelAccountSnapshot[]>();

29+

const rawAccounts = payload?.channelAccounts;

30+

if (!rawAccounts || typeof rawAccounts !== "object") {

31+

return out;

32+

}

33+

for (const [channelId, accounts] of Object.entries(rawAccounts)) {

34+

if (!Array.isArray(accounts)) {

35+

continue;

36+

}

37+

const normalized = accounts.filter(

38+

(account): account is ChannelAccountSnapshot =>

39+

Boolean(account) &&

40+

typeof account === "object" &&

41+

typeof (account as { accountId?: unknown }).accountId === "string",

42+

);

43+

if (normalized.length > 0) {

44+

out.set(channelId, normalized);

45+

}

46+

}

47+

return out;

48+

}

49+50+

async function readGatewayChannelStatus(): Promise<RuntimeChannelStatus | null> {

51+

try {

52+

return (await callGateway({

53+

method: "channels.status",

54+

params: { probe: false, timeoutMs: 5_000 },

55+

timeoutMs: 5_000,

56+

})) as RuntimeChannelStatus;

57+

} catch {

58+

return null;

59+

}

60+

}

61+2062

const colorValue = (value: string) => {

2163

if (value === "none") {

2264

return theme.error(value);

@@ -39,14 +81,20 @@ function formatInstalled(value: boolean): string {

3981

return value ? theme.success("installed") : theme.warn("not installed");

4082

}

418342-

function formatTokenSource(source?: string): string {

84+

function formatCredentialSource(source?: string, status?: string): string {

4385

const value = source || "none";

44-

return `token=${colorValue(value)}`;

86+

if (status === "configured_unavailable" && value !== "none") {

87+

return theme.warn(`${value}-unavailable`);

88+

}

89+

return colorValue(value);

4590

}

469147-

function formatSource(label: string, source?: string): string {

48-

const value = source || "none";

49-

return `${label}=${colorValue(value)}`;

92+

function formatTokenSource(source?: string, status?: string): string {

93+

return `token=${formatCredentialSource(source, status)}`;

94+

}

95+96+

function formatSource(label: string, source?: string, status?: string): string {

97+

return `${label}=${formatCredentialSource(source, status)}`;

5098

}

519952100

function formatLinked(value: boolean): string {

@@ -83,13 +131,13 @@ function formatAccountLine(params: {

83131

bits.push(formatLinked(snapshot.linked));

84132

}

85133

if (snapshot.tokenSource) {

86-

bits.push(formatTokenSource(snapshot.tokenSource));

134+

bits.push(formatTokenSource(snapshot.tokenSource, snapshot.tokenStatus));

87135

}

88136

if (snapshot.botTokenSource) {

89-

bits.push(formatSource("bot", snapshot.botTokenSource));

137+

bits.push(formatSource("bot", snapshot.botTokenSource, snapshot.botTokenStatus));

90138

}

91139

if (snapshot.appTokenSource) {

92-

bits.push(formatSource("app", snapshot.appTokenSource));

140+

bits.push(formatSource("app", snapshot.appTokenSource, snapshot.appTokenStatus));

93141

}

94142

if (snapshot.baseUrl) {

95143

bits.push(`base=${theme.muted(snapshot.baseUrl)}`);

@@ -129,6 +177,10 @@ export async function channelsListCommand(

129177

cfg,

130178

...(workspaceDir ? { workspaceDir } : {}),

131179

});

180+

const runtimeAccountsByChannel =

181+

opts.json === true

182+

? new Map<string, ChannelAccountSnapshot[]>()

183+

: normalizeRuntimeAccounts(await readGatewayChannelStatus());

132184

const installedByChannelId = new Map<string, boolean>();

133185

for (const entry of catalogEntries) {

134186

installedByChannelId.set(

@@ -158,8 +210,14 @@ export async function channelsListCommand(

158210

const accountIds = plugin.config.listAccountIds(cfg);

159211

if (accountIds && accountIds.length > 0) {

160212

renderedChannelIds.add(plugin.id);

161-

for (const accountId of accountIds) {

162-

const snapshot = await buildChannelAccountSnapshot({ plugin, cfg, accountId });

213+

const runtimeAccounts = runtimeAccountsByChannel.get(plugin.id) ?? [];

214+

const mergedAccountIds = [

215+

...new Set([...accountIds, ...runtimeAccounts.map((account) => account.accountId)]),

216+

];

217+

for (const accountId of mergedAccountIds) {

218+

const runtimeSnapshot = runtimeAccounts.find((account) => account.accountId === accountId);

219+

const snapshot =

220+

runtimeSnapshot ?? (await buildChannelAccountSnapshot({ plugin, cfg, accountId }));

163221

accountLines.push({

164222

plugin,

165223

snapshot,

@@ -184,10 +242,13 @@ export async function channelsListCommand(

184242

cfg,

185243

accountId: "default",

186244

});

245+

const runtimeSnapshot = runtimeAccountsByChannel

246+

.get(plugin.id)

247+

?.find((account) => account.accountId === "default");

187248

renderedChannelIds.add(plugin.id);

188249

accountLines.push({

189250

plugin,

190-

snapshot,

251+

snapshot: runtimeSnapshot ?? snapshot,

191252

installed: isInstalled(plugin.id),

192253

});

193254

}