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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Last Week in AI
Last Week in AI
罗磊的独立博客
腾讯CDC
云风的 BLOG
云风的 BLOG
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
U
Unit 42
I
InfoQ
D
DataBreaches.Net
Blog — PlanetScale
Blog — PlanetScale
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
美团技术团队
IT之家
IT之家
Stack Overflow Blog
Stack Overflow Blog
F
Fortinet All Blogs
GbyAI
GbyAI
S
SegmentFault 最新的问题

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: make Discord voice reconnect timing resilient · open...
steipete · 2026-05-01 · via Recent Commits to openclaw:main

@@ -35,8 +35,10 @@ import {

3535

CAPTURE_FINALIZE_GRACE_MS,

3636

isVoiceChannel,

3737

logVoiceVerbose,

38+

resolveVoiceTimeoutMs,

3839

MIN_SEGMENT_SECONDS,

3940

VOICE_CONNECT_READY_TIMEOUT_MS,

41+

VOICE_RECONNECT_GRACE_MS,

4042

type VoiceOperationResult,

4143

type VoiceSessionEntry,

4244

} from "./session.js";

@@ -172,13 +174,22 @@ export class DiscordVoiceManager {

172174

return { ok: false, message: "Discord voice plugin is not available." };

173175

}

174176177+

const voiceConfig = this.params.discordConfig.voice;

175178

const adapterCreator = voicePlugin.getGatewayAdapterCreator(guildId);

176-

const daveEncryption = this.params.discordConfig.voice?.daveEncryption;

177-

const decryptionFailureTolerance = this.params.discordConfig.voice?.decryptionFailureTolerance;

179+

const daveEncryption = voiceConfig?.daveEncryption;

180+

const decryptionFailureTolerance = voiceConfig?.decryptionFailureTolerance;

181+

const connectReadyTimeoutMs = resolveVoiceTimeoutMs(

182+

voiceConfig?.connectTimeoutMs,

183+

VOICE_CONNECT_READY_TIMEOUT_MS,

184+

);

185+

const reconnectGraceMs = resolveVoiceTimeoutMs(

186+

voiceConfig?.reconnectGraceMs,

187+

VOICE_RECONNECT_GRACE_MS,

188+

);

178189

logVoiceVerbose(

179190

`join: DAVE settings encryption=${daveEncryption === false ? "off" : "on"} tolerance=${

180191

decryptionFailureTolerance ?? "default"

181-

}`,

192+

} connectTimeout=${connectReadyTimeoutMs}ms reconnectGrace=${reconnectGraceMs}ms`,

182193

);

183194

const voiceSdk = loadDiscordVoiceSdk();

184195

const connection = voiceSdk.joinVoiceChannel({

@@ -195,10 +206,13 @@ export class DiscordVoiceManager {

195206

await voiceSdk.entersState(

196207

connection,

197208

voiceSdk.VoiceConnectionStatus.Ready,

198-

VOICE_CONNECT_READY_TIMEOUT_MS,

209+

connectReadyTimeoutMs,

199210

);

200211

logVoiceVerbose(`join: connected to guild ${guildId} channel ${channelId}`);

201212

} catch (err) {

213+

logger.warn(

214+

`discord voice: join failed before ready: guild ${guildId} channel ${channelId} timeout=${connectReadyTimeoutMs}ms error=${formatErrorMessage(err)}`,

215+

);

202216

connection.destroy();

203217

return { ok: false, message: `Failed to join voice channel: ${formatErrorMessage(err)}` };

204218

}

@@ -289,11 +303,26 @@ export class DiscordVoiceManager {

289303290304

disconnectedHandler = async () => {

291305

try {

306+

logVoiceVerbose(

307+

`disconnected: attempting recovery guild ${guildId} channel ${channelId} grace=${reconnectGraceMs}ms`,

308+

);

292309

await Promise.race([

293-

voiceSdk.entersState(connection, voiceSdk.VoiceConnectionStatus.Signalling, 5_000),

294-

voiceSdk.entersState(connection, voiceSdk.VoiceConnectionStatus.Connecting, 5_000),

310+

voiceSdk.entersState(

311+

connection,

312+

voiceSdk.VoiceConnectionStatus.Signalling,

313+

reconnectGraceMs,

314+

),

315+

voiceSdk.entersState(

316+

connection,

317+

voiceSdk.VoiceConnectionStatus.Connecting,

318+

reconnectGraceMs,

319+

),

295320

]);

296-

} catch {

321+

logVoiceVerbose(`disconnected: recovery started guild ${guildId} channel ${channelId}`);

322+

} catch (err) {

323+

logger.warn(

324+

`discord voice: disconnect recovery failed: guild ${guildId} channel ${channelId} timeout=${reconnectGraceMs}ms error=${formatErrorMessage(err)}; destroying connection`,

325+

);

297326

clearSessionIfCurrent();

298327

connection.destroy();

299328

}