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

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Engineering at Meta
Engineering at Meta
小众软件
小众软件
I
InfoQ
有赞技术团队
有赞技术团队
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
月光博客
月光博客
雷峰网
雷峰网
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
The GitHub Blog
The GitHub Blog
Y
Y Combinator Blog
V
Visual Studio Blog
博客园 - 叶小钗
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
GbyAI
GbyAI
P
Proofpoint News Feed
Apple Machine Learning Research
Apple Machine Learning Research

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(gateway): preserve runtime-backed health state (#7241...
vincentkoc · 2026-04-28 · via Recent Commits to openclaw:main

@@ -13,6 +13,10 @@ let setActivePluginRegistry: typeof import("../plugins/runtime.js").setActivePlu

1313

let createChannelTestPluginBase: typeof import("../test-utils/channel-plugins.js").createChannelTestPluginBase;

1414

let createTestRegistry: typeof import("../test-utils/channel-plugins.js").createTestRegistry;

1515

let getHealthSnapshot: typeof import("./health.js").getHealthSnapshot;

16+

let buildTelegramHealthSummaryForTest = buildTelegramHealthSummary;

17+

let probeTelegramAccountForTestOverride:

18+

| ((account: TelegramHealthAccount, timeoutMs: number) => Promise<Record<string, unknown>>)

19+

| undefined;

16201721

type TelegramHealthAccount = {

1822

accountId: string;

@@ -289,9 +293,12 @@ function createTelegramHealthPlugin(): Pick<

289293

isConfigured: (account) => Boolean((account as TelegramHealthAccount).token.trim()),

290294

},

291295

status: {

292-

buildChannelSummary: ({ snapshot }) => buildTelegramHealthSummary(snapshot),

296+

buildChannelSummary: ({ snapshot }) => buildTelegramHealthSummaryForTest(snapshot),

293297

probeAccount: async ({ account, timeoutMs }) =>

294-

await probeTelegramAccountForTest(account as TelegramHealthAccount, timeoutMs),

298+

await (probeTelegramAccountForTestOverride ?? probeTelegramAccountForTest)(

299+

account as TelegramHealthAccount,

300+

timeoutMs,

301+

),

295302

},

296303

};

297304

}

@@ -307,6 +314,8 @@ describe("getHealthSnapshot", () => {

307314

});

308315309316

beforeEach(() => {

317+

buildTelegramHealthSummaryForTest = buildTelegramHealthSummary;

318+

probeTelegramAccountForTestOverride = undefined;

310319

setActivePluginRegistry(

311320

createTestRegistry([

312321

{ pluginId: "telegram", plugin: createTelegramHealthPlugin(), source: "test" },

@@ -421,6 +430,116 @@ describe("getHealthSnapshot", () => {

421430

}

422431

});

423432433+

it("preserves runtime state and probe payloads when plugin summaries omit them", async () => {

434+

testConfig = { channels: { telegram: { botToken: "t-1" } } };

435+

testStore = {};

436+

vi.stubEnv("DISCORD_BOT_TOKEN", "");

437+

buildTelegramHealthSummaryForTest = (snapshot) => ({

438+

accountId: snapshot.accountId,

439+

configured: Boolean(snapshot.configured),

440+

});

441+

probeTelegramAccountForTestOverride = async () => ({

442+

ok: true,

443+

bot: { username: "runtime_bot" },

444+

});

445+446+

const snap = await getHealthSnapshot({

447+

timeoutMs: 25,

448+

runtimeSnapshot: {

449+

channels: {

450+

telegram: {

451+

accountId: "default",

452+

connected: true,

453+

lastConnectedAt: 123,

454+

},

455+

},

456+

channelAccounts: {},

457+

},

458+

});

459+

const telegram = snap.channels.telegram as {

460+

connected?: boolean;

461+

lastConnectedAt?: number;

462+

probe?: { ok?: boolean; bot?: { username?: string } };

463+

accounts?: Record<

464+

string,

465+

{

466+

connected?: boolean;

467+

lastConnectedAt?: number;

468+

probe?: { ok?: boolean; bot?: { username?: string } };

469+

}

470+

>;

471+

};

472+473+

expect(telegram.connected).toBe(true);

474+

expect(telegram.lastConnectedAt).toBe(123);

475+

expect(telegram.probe?.bot?.username).toBe("runtime_bot");

476+

expect(telegram.accounts?.default?.connected).toBe(true);

477+

expect(telegram.accounts?.default?.probe?.ok).toBe(true);

478+

});

479+480+

it("omits secret runtime fields and raw probe payloads from non-sensitive health snapshots", async () => {

481+

testConfig = { channels: { telegram: { botToken: "t-1" } } };

482+

testStore = {};

483+

vi.stubEnv("DISCORD_BOT_TOKEN", "");

484+

buildTelegramHealthSummaryForTest = (snapshot) => ({

485+

accountId: snapshot.accountId,

486+

configured: Boolean(snapshot.configured),

487+

probe: { ok: true, token: "summary-secret" },

488+

});

489+

probeTelegramAccountForTestOverride = async () => ({

490+

ok: true,

491+

bot: { username: "runtime_bot" },

492+

token: "probe-secret",

493+

});

494+495+

const snap = await getHealthSnapshot({

496+

timeoutMs: 25,

497+

includeSensitive: false,

498+

runtimeSnapshot: {

499+

channels: {

500+

telegram: {

501+

accountId: "default",

502+

connected: true,

503+

lastConnectedAt: 123,

504+

channelAccessToken: "line-token",

505+

channelSecret: "line-secret", // pragma: allowlist secret

506+

webhookUrl: "https://example.test/hook?secret=1",

507+

},

508+

},

509+

channelAccounts: {},

510+

},

511+

});

512+

const telegram = snap.channels.telegram as {

513+

connected?: boolean;

514+

lastConnectedAt?: number;

515+

probe?: unknown;

516+

channelAccessToken?: string;

517+

channelSecret?: string;

518+

webhookUrl?: string;

519+

accounts?: Record<

520+

string,

521+

{

522+

connected?: boolean;

523+

lastConnectedAt?: number;

524+

probe?: unknown;

525+

channelAccessToken?: string;

526+

channelSecret?: string;

527+

webhookUrl?: string;

528+

}

529+

>;

530+

};

531+532+

expect(telegram.connected).toBe(true);

533+

expect(telegram.lastConnectedAt).toBe(123);

534+

expect(telegram.probe).toBeUndefined();

535+

expect(telegram.channelAccessToken).toBeUndefined();

536+

expect(telegram.channelSecret).toBeUndefined();

537+

expect(telegram.webhookUrl).toBeUndefined();

538+

expect(telegram.accounts?.default?.connected).toBe(true);

539+

expect(telegram.accounts?.default?.probe).toBeUndefined();

540+

expect(telegram.accounts?.default?.channelAccessToken).toBeUndefined();

541+

});

542+424543

it("returns structured telegram probe errors", async () => {

425544

testConfig = { channels: { telegram: { botToken: "bad-token" } } };

426545

testStore = {};