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

推荐订阅源

N
Netflix TechBlog - Medium
J
Java Code Geeks
爱范儿
爱范儿
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
博客园 - 三生石上(FineUI控件)
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog RSS Feed
Google DeepMind News
Google DeepMind News
Jina AI
Jina AI
The GitHub Blog
The GitHub Blog
I
InfoQ
月光博客
月光博客
博客园 - 聂微东
博客园 - Franky
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园_首页
G
Google Developers Blog
Blog — PlanetScale
Blog — PlanetScale
L
LangChain Blog
罗磊的独立博客
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(discord): avoid blocking startup on probe (#77129) · ...
steipete · 2026-05-04 · via Recent Commits to openclaw:main

@@ -379,7 +379,7 @@ describe("discordPlugin outbound", () => {

379379

expect(runtimeProbeDiscord).not.toHaveBeenCalled();

380380

});

381381382-

it("uses direct Discord startup helpers before monitoring", async () => {

382+

it("uses direct Discord startup helpers for async startup enrichment", async () => {

383383

const runtimeProbeDiscord = vi.fn(async () => {

384384

throw new Error("runtime Discord probe should not be used");

385385

});

@@ -407,9 +407,11 @@ describe("discordPlugin outbound", () => {

407407

const cfg = createCfg();

408408

await startDiscordAccount(cfg);

409409410-

expect(probeDiscordMock).toHaveBeenCalledWith("discord-token", 2500, {

411-

includeApplication: true,

412-

});

410+

await vi.waitFor(() =>

411+

expect(probeDiscordMock).toHaveBeenCalledWith("discord-token", 2500, {

412+

includeApplication: true,

413+

}),

414+

);

413415

expect(monitorDiscordProviderMock).toHaveBeenCalledWith(

414416

expect.objectContaining({

415417

token: "discord-token",

@@ -421,6 +423,98 @@ describe("discordPlugin outbound", () => {

421423

expect(runtimeMonitorDiscordProvider).not.toHaveBeenCalled();

422424

});

423425426+

it("does not block Discord monitor startup on the startup probe", async () => {

427+

let resolveProbe!: (value: {

428+

ok: true;

429+

bot: { username: string };

430+

application: { intents: { messageContent: "limited" } };

431+

elapsedMs: number;

432+

}) => void;

433+

probeDiscordMock.mockReturnValue(

434+

new Promise((resolve) => {

435+

resolveProbe = resolve;

436+

}),

437+

);

438+

monitorDiscordProviderMock.mockResolvedValue(undefined);

439+440+

const cfg = createCfg();

441+

const statusPatches: Array<Record<string, unknown>> = [];

442+

const ctx = createStartAccountContext({

443+

account: resolveAccount(cfg),

444+

cfg,

445+

statusPatchSink: (next) => statusPatches.push({ ...next }),

446+

});

447+448+

await discordPlugin.gateway!.startAccount!(ctx);

449+450+

expect(monitorDiscordProviderMock).toHaveBeenCalledWith(

451+

expect.objectContaining({

452+

token: "discord-token",

453+

accountId: "default",

454+

}),

455+

);

456+

await vi.waitFor(() =>

457+

expect(probeDiscordMock).toHaveBeenCalledWith("discord-token", 2500, {

458+

includeApplication: true,

459+

}),

460+

);

461+

expect(statusPatches.some((patch) => "bot" in patch || "application" in patch)).toBe(false);

462+463+

resolveProbe({

464+

ok: true,

465+

bot: { username: "AsyncBob" },

466+

application: { intents: { messageContent: "limited" } },

467+

elapsedMs: 1,

468+

});

469+470+

await vi.waitFor(() =>

471+

expect(

472+

statusPatches.some(

473+

(patch) =>

474+

(patch.bot as { username?: string } | undefined)?.username === "AsyncBob" &&

475+

Boolean(patch.application),

476+

),

477+

).toBe(true),

478+

);

479+

});

480+481+

it("clears stale Discord probe metadata when the async startup probe degrades", async () => {

482+

probeDiscordMock.mockResolvedValue({

483+

ok: false,

484+

status: 401,

485+

error: "getMe failed (401)",

486+

elapsedMs: 1,

487+

});

488+

monitorDiscordProviderMock.mockResolvedValue(undefined);

489+490+

const cfg = createCfg();

491+

const statusPatches: Array<Record<string, unknown>> = [];

492+

const ctx = createStartAccountContext({

493+

account: resolveAccount(cfg),

494+

cfg,

495+

statusPatchSink: (next) => statusPatches.push({ ...next }),

496+

});

497+

ctx.setStatus({

498+

accountId: "default",

499+

bot: { username: "OldBot" },

500+

application: { intents: { messageContent: "enabled" } },

501+

});

502+503+

await discordPlugin.gateway!.startAccount!(ctx);

504+505+

await vi.waitFor(() =>

506+

expect(

507+

statusPatches.some(

508+

(patch) =>

509+

"bot" in patch &&

510+

"application" in patch &&

511+

patch.bot === undefined &&

512+

patch.application === undefined,

513+

),

514+

).toBe(true),

515+

);

516+

});

517+424518

it("stagger starts later accounts in multi-bot setups", async () => {

425519

probeDiscordMock.mockResolvedValue({

426520

ok: true,