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

推荐订阅源

小众软件
小众软件
WordPress大学
WordPress大学
IT之家
IT之家
G
Google Developers Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler
V
V2EX
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
V
Visual Studio Blog
有赞技术团队
有赞技术团队
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 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(discord): reconnect after missed identify · openclaw/...
steipete · 2026-05-02 · via Recent Commits to openclaw:main
Original file line numberDiff line numberDiff line change

@@ -28,6 +28,7 @@ Docs: https://docs.openclaw.ai

2828
2929

### Fixes

3030
31+

- Discord/gateway: reconnect when the gateway socket closes while waiting for the shared IDENTIFY concurrency window, instead of silently skipping IDENTIFY and leaving the bot online but unresponsive. Fixes #74617. Thanks @zeeskdr-ai.

3132

- Telegram/startup: use the existing `getMe` request guard for the gateway bot probe instead of a fixed 2.5-second budget, and honor higher `timeoutSeconds` configs for slow Telegram API paths. Fixes #75783. Thanks @tankotan.

3233

- Infer/media: report missing image-understanding and audio-transcription provider configuration for `image describe`, `image describe-many`, and `audio transcribe` instead of blaming the input path when no provider is available. Fixes #73569 and supersedes #73593, #74288, and #74495. Thanks @bittoby, @tmimmanuel, @Linux2010, and @vyctorbrzezowski.

3334

- Docs/health: clarify that session listing surfaces stored conversation rows rather than Discord/channel socket liveness, and point connectivity checks at channel status and health probes. Fixes #70420. Thanks @ashersoutherncities-art and @martingarramon.

Original file line numberDiff line numberDiff line change

@@ -127,6 +127,42 @@ describe("GatewayPlugin", () => {

127127

await vi.waitFor(() => expect(errorSpy).toHaveBeenCalledWith(error));

128128

});

129129
130+

it("reconnects when the socket closes while waiting for identify concurrency", async () => {

131+

vi.useFakeTimers();

132+

vi.setSystemTime(0);

133+

await sharedGatewayIdentifyLimiter.wait({ shardId: 0, maxConcurrency: 1 });

134+

const gateway = new TestGatewayPlugin({

135+

autoInteractions: false,

136+

url: "wss://gateway.example.test",

137+

});

138+

const errorSpy = vi.fn();

139+

gateway.emitter.on("error", errorSpy);

140+
141+

gateway.connect(false);

142+

const socket = gateway.sockets[0];

143+

socket?.emit("open");

144+

socket?.emit(

145+

"message",

146+

JSON.stringify({

147+

op: GatewayOpcodes.Hello,

148+

d: { heartbeat_interval: 45_000 },

149+

s: null,

150+

}),

151+

);

152+

if (socket) {

153+

socket.readyState = 3;

154+

}

155+
156+

await vi.advanceTimersByTimeAsync(5_000);

157+

expect(errorSpy).toHaveBeenCalledWith(

158+

new Error("Discord gateway socket closed before IDENTIFY could be sent"),

159+

);

160+

await vi.advanceTimersByTimeAsync(2_000);

161+
162+

expect(gateway.connectCalls).toEqual([false, false]);

163+

expect(gateway.sockets).toHaveLength(2);

164+

});

165+
130166

it("preserves MESSAGE_CREATE author payloads for inbound dispatch", async () => {

131167

const gateway = new GatewayPlugin({ autoInteractions: false });

132168

const dispatchGatewayEvent = vi.fn(async (_event: string, _data: unknown) => {});

Original file line numberDiff line numberDiff line change

@@ -248,7 +248,12 @@ export class GatewayPlugin extends Plugin {

248248

true,

249249

);

250250

} else {

251-

void this.identifyWithConcurrency();

251+

void this.identifyWithConcurrency().catch((error: unknown) => {

252+

this.emitter.emit(

253+

"error",

254+

error instanceof Error ? error : new Error(String(error), { cause: error }),

255+

);

256+

});

252257

}

253258

break;

254259

case GatewayOpcodes.HeartbeatAck:

@@ -325,7 +330,13 @@ export class GatewayPlugin extends Plugin {

325330

shardId: this.shardId,

326331

maxConcurrency: this.gatewayInfo?.session_start_limit.max_concurrency,

327332

});

328-

if (!this.ws || this.ws.readyState !== READY_STATE_OPEN) {

333+

const socket = this.ws;

334+

if (!socket || socket.readyState !== READY_STATE_OPEN) {

335+

const error = new Error("Discord gateway socket closed before IDENTIFY could be sent");

336+

this.emitter.emit("error", error);

337+

if (socket) {

338+

this.scheduleReconnect(false);

339+

}

329340

return;

330341

}

331342

this.identify();