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

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
S
SegmentFault 最新的问题
Project Zero
Project Zero
D
DataBreaches.Net
I
InfoQ
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
The Register - Security
The Register - Security
Recorded Future
Recorded Future
Vercel News
Vercel News
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
Intezer
The Hacker News
The Hacker News
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Scott Helme
Scott Helme
T
Threatpost
爱范儿
爱范儿
N
Netflix TechBlog - Medium
D
Docker
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
K
Kaspersky official blog
H
Help Net Security
S
Secure Thoughts
T
Threat Research - Cisco Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
G
Google Developers Blog
Forbes - Security
Forbes - Security
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
B
Blog
Google DeepMind News
Google DeepMind News
Recent Announcements
Recent Announcements
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
P
Privacy International News Feed
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog

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 test: trim doctor command hotspots · openclaw/openclaw@c66f16a test: isolate agent auth and spawn hotspots · openclaw/openclaw@9285935 test: stabilize MCP startup disposal race · openclaw/openclaw@dd9d2eb test: merge browser contract server suites · openclaw/openclaw@5817a76 test: narrow ollama provider discovery setup · openclaw/openclaw@a0d9598 build: declare qa-lab aimock runtime dependency · openclaw/openclaw@24431e5 test: speed up safe-bins exec harness · openclaw/openclaw@ee856ab test: preserve tool helpers in embedded runner mocks · openclaw/openclaw@acd86a0 refactor: move memory embeddings into provider plugins · openclaw/openclaw@77e6e4c test: reuse system-run temp fixtures · openclaw/openclaw@7e9ff0f test: trim hotspot wait overhead · openclaw/openclaw@12a59b0 Check: avoid duplicate boundary prep · openclaw/openclaw@baf11b8 test: reduce hotspot fixture overhead · openclaw/openclaw@3a59edd feat(ui): overhaul settings and slash command UX (#67819) thanks @Bun… · openclaw/openclaw@2cfb660 QA Matrix: exit cleanly on failure · openclaw/openclaw@42805d2 QA Matrix: isolate scenario coverage · openclaw/openclaw@7e659e1 Matrix: refresh crypto bootstrap state · openclaw/openclaw@94081d8 QA Lab: add provider registry · openclaw/openclaw@bb7e982 Matrix: add plugin changelog · openclaw/openclaw@4acab55 test: trim more hotspot overhead · openclaw/openclaw@f485311 test: trim remaining hotspot tests · openclaw/openclaw@6ba8626 test: narrow hotspot mocks · openclaw/openclaw@dbc8179 test: isolate gemini embedding request helpers · openclaw/openclaw@cd330f5 test: trim memory and mcp hotspots · openclaw/openclaw@fd48dfa test: slim provider registry mocks · openclaw/openclaw@2e08c77 test: harden Parallels update smoke · openclaw/openclaw@1a98090 feat: default Anthropic to Opus 4.7 · openclaw/openclaw@628b454 fix: harden node-host shell payload mutability checks · openclaw/openclaw@75c551e fix: land node-host approval binding for native binaries (#66731) (th… · openclaw/openclaw@29919bb CI: add daily schedule to CodeQL workflow (#67645) · openclaw/openclaw@69d25f5 fix(gateway): capture config hash after plugin auto-enable to prevent… · openclaw/openclaw@8c11210 fix: repair sanitized replay tool results before send (#67620) (thank… · openclaw/openclaw@c3c7a99 fix: restrict HTML timeout short-circuit to transient statuses · openclaw/openclaw@de129a6 fix: keep TUI watchdog bound to active run (#67401) (thanks @xantorres) · openclaw/openclaw@3525273 Gateway/skills: dedupe skills prefix-match + drop dead fallback on log · openclaw/openclaw@d7f489f Extensions/lmstudio: back off inference preload after consecutive fai… · openclaw/openclaw@b555214 TUI/streaming: add watchdog that resets the activity indicator after … · openclaw/openclaw@f44ab20 Agents/tool-loop: enable unknown-tool stream guard by default · openclaw/openclaw@36ed367 Gateway/skills: invalidate session skills snapshot on config write · openclaw/openclaw@b23d59a fix: classify HTML provider error pages correctly (#67642) (thanks @s… · openclaw/openclaw@e588e90 fix(skills): remove unused model-usage import (#67641) · openclaw/openclaw@55f05df docs(changelog): credit codex fix superseded PRs · openclaw/openclaw@e485f24 fix(openai-codex): normalize stale transport metadata in resolution a… · openclaw/openclaw@90801ba CI: pin Docker-related GitHub Actions (#67632) · openclaw/openclaw@f697b01 Android: modernize WebView and discovery API usage (#67627) · openclaw/openclaw@44a6e50 fix(deps): bump hono to 4.12.14 and @hono/node-server to 1.19.14 (GHS… · openclaw/openclaw@fbccc18 fix(deps): bump dompurify to 3.4.0 (#67614) · openclaw/openclaw@2c2dc00 CI: add explicit permissions to all workflow jobs (fixes code-scannin… · openclaw/openclaw@01b7516 fix: register bundled TTS providers and route overrides correctly (#6… · openclaw/openclaw@6ea3cdd fix: align host tilde paths with OS home (#62804) (thanks @stainlu) · openclaw/openclaw@ecfaf64 fix: flush creds queue before reconnect socket open (#67464) (thanks … · openclaw/openclaw@405c63f fix: strip standalone <function> tool call tags from visible text (#6… · openclaw/openclaw@78df859 fix(agents): preserve cli session metadata before transcript persist … · openclaw/openclaw@898fd04 docs(changelog): move cli transcript entry · openclaw/openclaw@c1817c6 fix(agents): normalize cli transcript api field · openclaw/openclaw@3a3fae0 docs(changelog): note cli transcript persistence · openclaw/openclaw@6c343f1 fix(agents): persist cli transcript turns · openclaw/openclaw@b8ef507 fix(msteams): harden security-sensitive flows (#65841) · openclaw/openclaw@c56b56e [Dashboard] Fix exec approval modal overflow for long command content… · openclaw/openclaw@053c5b0 Docs: remove QA changelog entry · openclaw/openclaw@7fd5771 QA: fix private runtime source loading (#67428) · openclaw/openclaw@d5933af docs(gateway): correct protocol.md schema path, hello-ok example, aut… · openclaw/openclaw@489404d CI: pin Node 22 runners to 22.18.0 · openclaw/openclaw@4ffa621 models.authStatus: normalize provider ids + tighten env-backed escape… · openclaw/openclaw@f2fdb9d Update CHANGELOG.md · openclaw/openclaw@7694a92 test(parallels): clean up npm update guard jobs · openclaw/openclaw@045ea7b Plugins: prefer scanDir override paths · openclaw/openclaw@b2974da fix(dreaming): default storage.mode to "separate" so phase blocks sto… · openclaw/openclaw@8c392f0 fix(memory-core): skip dreaming transcript ingestion via session stor… · openclaw/openclaw@a1b01f0 fix: dedupe replayed exec.finished node events (#67281) · openclaw/openclaw@5dcf526
Refactor realtime voice turn context tracking (#86650) · openclaw/openclaw@fda0141
steipete · 2026-05-26 · via Recent Commits to openclaw:main

@@ -7,6 +7,7 @@ import {

77

controlRealtimeVoiceAgentRun,

88

createRealtimeVoiceAgentTalkbackQueue,

99

createRealtimeVoiceBridgeSession,

10+

createRealtimeVoiceTurnContextTracker,

1011

matchRealtimeVoiceActivationName,

1112

matchRealtimeVoiceConsultQuestions,

1213

normalizeSupportedRealtimeVoiceActivationName,

@@ -26,6 +27,8 @@ import {

2627

type RealtimeVoiceBridgeSession,

2728

type RealtimeVoiceProviderConfig,

2829

type RealtimeVoiceToolCallEvent,

30+

type RealtimeVoiceTurnContextHandle,

31+

type RealtimeVoiceTurnContextTracker,

2932

sortRealtimeVoiceActivationNames,

3033

type RealtimeVoiceActivationNameTranscriptResult,

3134

} from "openclaw/plugin-sdk/realtime-voice";

@@ -94,18 +97,18 @@ type DiscordRealtimeSpeakerContext = VoiceRealtimeSpeakerContext & { userId: str

94979598

type DiscordRealtimeVoiceConfig = NonNullable<DiscordAccountConfig["voice"]>["realtime"];

969997-

type PendingSpeakerTurn = {

98-

context: DiscordRealtimeSpeakerContext;

99-

hasAudio: boolean;

100+

type PendingSpeakerTurnStats = {

100101

inputDiscordBytes: number;

101102

inputRealtimeBytes: number;

102103

inputChunks: number;

103104

interruptedPlayback: boolean;

104-

closed: boolean;

105-

startedAt: number;

106-

lastAudioAt?: number;

107105

};

108106107+

type PendingSpeakerTurn = RealtimeVoiceTurnContextHandle<

108+

DiscordRealtimeSpeakerContext,

109+

PendingSpeakerTurnStats

110+

>;

111+109112

type PendingAgentProxyConsultContext = {

110113

context: DiscordRealtimeSpeakerContext;

111114

question: string;

@@ -126,11 +129,6 @@ type RecentAgentProxyConsultContext = {

126129

result?: RecentAgentProxyConsultResult;

127130

};

128131129-

type RecentIgnoredWakeNameSpeakerContext = {

130-

context: DiscordRealtimeSpeakerContext;

131-

createdAt: number;

132-

};

133-134132

function formatRealtimeLogPreview(text: string): string {

135133

const oneLine = text.replace(/\s+/g, " ").trim();

136134

if (oneLine.length <= DISCORD_REALTIME_LOG_PREVIEW_CHARS) {

@@ -366,8 +364,15 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

366364

private wakeNames: string[] = [];

367365

private pendingAgentProxyConsultContexts: PendingAgentProxyConsultContext[] = [];

368366

private recentAgentProxyConsultContexts: RecentAgentProxyConsultContext[] = [];

369-

private recentIgnoredWakeNameSpeakerContext: RecentIgnoredWakeNameSpeakerContext | undefined;

370-

private readonly pendingSpeakerTurns: PendingSpeakerTurn[] = [];

367+

private readonly speakerTurns: RealtimeVoiceTurnContextTracker<

368+

DiscordRealtimeSpeakerContext,

369+

PendingSpeakerTurnStats

370+

> = createRealtimeVoiceTurnContextTracker<DiscordRealtimeSpeakerContext, PendingSpeakerTurnStats>(

371+

{

372+

limit: DISCORD_REALTIME_PENDING_SPEAKER_CONTEXT_LIMIT,

373+

ignoredContextTtlMs: DISCORD_REALTIME_IGNORED_WAKE_NAME_CONTEXT_TTL_MS,

374+

},

375+

);

371376

private outputAudioTimestampMs = 0;

372377

private outputAudioDiscordBytes = 0;

373378

private outputAudioRealtimeBytes = 0;

@@ -573,8 +578,7 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

573578

this.clearForcedConsultTimers();

574579

this.pendingAgentProxyConsultContexts = [];

575580

this.recentAgentProxyConsultContexts = [];

576-

this.recentIgnoredWakeNameSpeakerContext = undefined;

577-

this.pendingSpeakerTurns.length = 0;

581+

this.speakerTurns.clear();

578582

this.queuedExactSpeechMessages = [];

579583

this.exactSpeechResponseActive = false;

580584

this.exactSpeechAudioStarted = false;

@@ -613,29 +617,25 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

613617614618

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

615619

this.resetPartialWakeNameTracking();

616-

const turn: PendingSpeakerTurn = {

617-

context: { ...context, userId },

618-

hasAudio: false,

619-

inputDiscordBytes: 0,

620-

inputRealtimeBytes: 0,

621-

inputChunks: 0,

622-

interruptedPlayback: false,

623-

closed: false,

624-

startedAt: Date.now(),

625-

};

626-

this.pendingSpeakerTurns.push(turn);

620+

const turn = this.speakerTurns.open(

621+

{ ...context, userId },

622+

{

623+

inputDiscordBytes: 0,

624+

inputRealtimeBytes: 0,

625+

inputChunks: 0,

626+

interruptedPlayback: false,

627+

},

628+

);

627629

logger.info(

628-

`discord voice: realtime speaker turn opened guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} user=${userId} speaker=${context.speakerLabel} owner=${context.senderIsOwner} pendingTurns=${this.pendingSpeakerTurns.length}`,

630+

`discord voice: realtime speaker turn opened guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} user=${userId} speaker=${context.speakerLabel} owner=${context.senderIsOwner} pendingTurns=${this.speakerTurns.size()}`,

629631

);

630-

this.prunePendingSpeakerTurns();

631632

return {

632633

sendInputAudio: (discordPcm48kStereo) =>

633634

this.sendInputAudioForTurn(turn, discordPcm48kStereo),

634635

close: () => {

635636

this.sendRealtimeTrailingSilenceForTurn(turn);

636637

this.logSpeakerTurnClosed(turn);

637-

turn.closed = true;

638-

this.prunePendingSpeakerTurns();

638+

this.speakerTurns.close(turn);

639639

},

640640

};

641641

}

@@ -644,13 +644,12 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

644644

if (!this.bridge || this.stopped) {

645645

return;

646646

}

647-

turn.hasAudio = true;

647+

this.speakerTurns.markAudio(turn);

648648

const realtimePcm = convertDiscordPcm48kStereoToRealtimePcm24kMono(discordPcm48kStereo);

649649

if (realtimePcm.length > 0) {

650650

turn.inputDiscordBytes += discordPcm48kStereo.length;

651651

turn.inputRealtimeBytes += realtimePcm.length;

652652

turn.inputChunks += 1;

653-

turn.lastAudioAt = Date.now();

654653

if (turn.inputChunks === 1) {

655654

logger.info(

656655

`discord voice: realtime input audio started guild=${this.params.entry.guildId} channel=${this.params.entry.channelId} user=${turn.context.userId} speaker=${turn.context.speakerLabel} discordBytes=${discordPcm48kStereo.length} realtimeBytes=${realtimePcm.length} outputAudioMs=${Math.floor(this.outputAudioTimestampMs)} outputActive=${this.isOutputAudioActive()}`,

@@ -1456,79 +1455,25 @@ export class DiscordRealtimeVoiceSession implements VoiceRealtimeSession {

14561455

}

1457145614581457

private consumePendingSpeakerContext(): DiscordRealtimeSpeakerContext | undefined {

1459-

this.prunePendingSpeakerTurns();

1460-

this.expireClosedSpeakerTurnsBeforeLaterAudio();

1461-

const index = this.pendingSpeakerTurns.findIndex((turn) => turn.hasAudio);

1462-

if (index < 0) {

1463-

return undefined;

1464-

}

1465-

const [turn] = this.pendingSpeakerTurns.splice(index, 1);

1466-

this.prunePendingSpeakerTurns();

1467-

return turn?.context;

1458+

return this.speakerTurns.consumeAudioContext();

14681459

}

1469146014701461

private rememberIgnoredWakeNameSpeakerContext(

14711462

context: DiscordRealtimeSpeakerContext | undefined,

14721463

): void {

1473-

if (!context) {

1474-

return;

1475-

}

1476-

this.recentIgnoredWakeNameSpeakerContext = {

1477-

context,

1478-

createdAt: Date.now(),

1479-

};

1464+

this.speakerTurns.rememberIgnoredContext(context);

14801465

}

1481146614821467

private consumeRecentIgnoredWakeNameSpeakerContext(): DiscordRealtimeSpeakerContext | undefined {

1483-

const recent = this.recentIgnoredWakeNameSpeakerContext;

1484-

this.recentIgnoredWakeNameSpeakerContext = undefined;

1485-

if (

1486-

!recent ||

1487-

Date.now() - recent.createdAt > DISCORD_REALTIME_IGNORED_WAKE_NAME_CONTEXT_TTL_MS

1488-

) {

1489-

return undefined;

1490-

}

1491-

return recent.context;

1468+

return this.speakerTurns.consumeIgnoredContext();

14921469

}

1493147014941471

private peekPendingSpeakerTurn(): PendingSpeakerTurn | undefined {

1495-

this.prunePendingSpeakerTurns();

1496-

this.expireClosedSpeakerTurnsBeforeLaterAudio();

1497-

return this.pendingSpeakerTurns.find((turn) => turn.hasAudio);

1472+

return this.speakerTurns.peekAudioTurn();

14981473

}

1499147415001475

private hasPendingSpeakerAudioContext(): boolean {

1501-

this.prunePendingSpeakerTurns();

1502-

this.expireClosedSpeakerTurnsBeforeLaterAudio();

1503-

return this.pendingSpeakerTurns.some((turn) => turn.hasAudio);

1504-

}

1505-1506-

private prunePendingSpeakerTurns(): void {

1507-

for (let index = this.pendingSpeakerTurns.length - 1; index >= 0; index -= 1) {

1508-

const turn = this.pendingSpeakerTurns[index];

1509-

if (turn?.closed && !turn.hasAudio) {

1510-

this.pendingSpeakerTurns.splice(index, 1);

1511-

}

1512-

}

1513-

while (this.pendingSpeakerTurns.length > DISCORD_REALTIME_PENDING_SPEAKER_CONTEXT_LIMIT) {

1514-

const completedIndex = this.pendingSpeakerTurns.findIndex((turn) => turn.closed);

1515-

this.pendingSpeakerTurns.splice(Math.max(completedIndex, 0), 1);

1516-

}

1517-

}

1518-1519-

private expireClosedSpeakerTurnsBeforeLaterAudio(): void {

1520-

let hasLaterAudio = false;

1521-

for (let index = this.pendingSpeakerTurns.length - 1; index >= 0; index -= 1) {

1522-

const turn = this.pendingSpeakerTurns[index];

1523-

if (!turn?.hasAudio) {

1524-

continue;

1525-

}

1526-

if (turn.closed && hasLaterAudio) {

1527-

this.pendingSpeakerTurns.splice(index, 1);

1528-

continue;

1529-

}

1530-

hasLaterAudio = true;

1531-

}

1476+

return this.speakerTurns.hasAudioContext();

15321477

}

1533147815341479

private rememberRecentAgentProxyConsultContext(