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

推荐订阅源

WordPress大学
WordPress大学
博客园 - 司徒正美
I
InfoQ
宝玉的分享
宝玉的分享
G
Google Developers Blog
J
Java Code Geeks
Martin Fowler
Martin Fowler
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
罗磊的独立博客
腾讯CDC
F
Fortinet All Blogs
A
About on SuperTechFans
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Recent Announcements
Recent Announcements
Last Week in AI
Last Week in AI
B
Blog RSS Feed
博客园 - 聂微东
D
DataBreaches.Net
Hugging Face - Blog
Hugging Face - Blog
The Cloudflare Blog
L
LangChain Blog
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏

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): quiet fatal realtime voice startup failures...
steipete · 2026-05-13 · via Recent Commits to openclaw:main

@@ -45,6 +45,7 @@ const DISCORD_REALTIME_RECENT_AGENT_PROXY_CONSULT_TTL_MS = 15_000;

4545

const DISCORD_REALTIME_LOG_PREVIEW_CHARS = 500;

4646

const DISCORD_REALTIME_DEFAULT_MIN_BARGE_IN_AUDIO_END_MS = 250;

4747

const DISCORD_REALTIME_FORCED_CONSULT_FALLBACK_DELAY_MS = 200;

48+

const DISCORD_REALTIME_DUPLICATE_ERROR_SUPPRESS_MS = 60_000;

4849

const REALTIME_PCM16_BYTES_PER_SAMPLE = 2;

4950

const DISCORD_REALTIME_FORCED_CONSULT_TRAILING_FRAGMENT_WORDS = new Set([

5051

"a",

@@ -332,6 +333,9 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

332333

private queuedExactSpeechMessages: string[] = [];

333334

private exactSpeechResponseActive = false;

334335

private exactSpeechAudioStarted = false;

336+

private lastRealtimeError:

337+

| { message: string; suppressed: number; lastLoggedAt: number }

338+

| undefined;

335339

private readonly playerIdleHandler = () => {

336340

this.resetOutputStream("player-idle");

337341

this.completeExactSpeechResponse("player-idle");

@@ -453,9 +457,11 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

453457

logger.info(interruptionLog);

454458

}

455459

},

456-

onError: (error) =>

457-

logger.warn(`discord voice: realtime error: ${formatErrorMessage(error)}`),

458-

onClose: (reason) => logVoiceVerbose(`realtime closed: ${reason}`),

460+

onError: (error) => this.logRealtimeError(formatErrorMessage(error)),

461+

onClose: (reason) => {

462+

this.flushSuppressedRealtimeErrors();

463+

logVoiceVerbose(`realtime closed: ${reason}`);

464+

},

459465

});

460466

const resolvedModel =

461467

readProviderConfigString(resolved.providerConfig, "model") ?? resolved.provider.defaultModel;

@@ -478,6 +484,7 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

478484479485

close(): void {

480486

this.stopped = true;

487+

this.flushSuppressedRealtimeErrors();

481488

this.talkback.close();

482489

this.clearForcedConsultTimers();

483490

this.pendingAgentProxyConsultContexts = [];

@@ -493,6 +500,30 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

493500

this.params.entry.player.off(voiceSdk.AudioPlayerStatus.Idle, this.playerIdleHandler);

494501

}

495502503+

private logRealtimeError(message: string): void {

504+

const now = Date.now();

505+

if (

506+

this.lastRealtimeError?.message === message &&

507+

now - this.lastRealtimeError.lastLoggedAt < DISCORD_REALTIME_DUPLICATE_ERROR_SUPPRESS_MS

508+

) {

509+

this.lastRealtimeError.suppressed += 1;

510+

return;

511+

}

512+

this.flushSuppressedRealtimeErrors();

513+

this.lastRealtimeError = { message, suppressed: 0, lastLoggedAt: now };

514+

logger.warn(`discord voice: realtime error: ${message}`);

515+

}

516+517+

private flushSuppressedRealtimeErrors(): void {

518+

if (!this.lastRealtimeError || this.lastRealtimeError.suppressed === 0) {

519+

return;

520+

}

521+

logger.warn(

522+

`discord voice: suppressed ${this.lastRealtimeError.suppressed} duplicate realtime errors: ${this.lastRealtimeError.message}`,

523+

);

524+

this.lastRealtimeError.suppressed = 0;

525+

}

526+496527

beginSpeakerTurn(context: VoiceRealtimeSpeakerContext, userId: string): VoiceRealtimeSpeakerTurn {

497528

const turn: PendingSpeakerTurn = {

498529

context: { ...context, userId },