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

推荐订阅源

N
News and Events Feed by Topic
V
V2EX
博客园 - 【当耐特】
Vercel News
Vercel News
雷峰网
雷峰网
爱范儿
爱范儿
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Azure Blog
Microsoft Azure Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
NISL@THU
NISL@THU
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
P
Proofpoint News Feed
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
I
InfoQ
Google Online Security Blog
Google Online Security Blog
L
LINUX DO - 最新话题
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
V
Visual Studio Blog
AI
AI
Schneier on Security
Schneier on Security
B
Blog RSS Feed
T
Tor Project blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Cyber Attacks, Cyber Crime and Cyber Security
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
Webroot Blog
Webroot Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

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
feat(ios): add talk tab realtime playback (#88105) · openclaw/openclaw@6897711
ngutman · 2026-05-30 · via Recent Commits to openclaw:main

@@ -17,7 +17,7 @@ private func makeRealtimeAudioTapBlock(

1717

inputSampleRate: inputSampleRate,

1818

targetSampleRate: targetSampleRate)

1919

guard !encoded.isEmpty else { return }

20-

let timestampMs = ProcessInfo.processInfo.systemUptime * 1000

20+

let timestampMs = (ProcessInfo.processInfo.systemUptime * 1000).rounded()

2121

let rms = RealtimeTalkRelaySession.rmsLevel(buffer: buffer)

2222

onAudio(encoded, timestampMs, rms)

2323

}

@@ -125,15 +125,24 @@ final class RealtimeTalkRelaySession {

125125

private var eventTask: Task<Void, Never>?

126126

private var outputTask: Task<Void, Never>?

127127

private var outputContinuation: AsyncThrowingStream<Data, Error>.Continuation?

128+

private var outputIdleTask: Task<Void, Never>?

129+

private var outputSessionId = 0

130+

private var pendingOutputChunks: [Data] = []

131+

private var pendingOutputDone = false

128132

private var audioSender: RealtimeAudioSender?

129133

private var isClosed = false

130134

private var isOutputPlaying = false

131135

private var outputStartedAtMs: Double?

136+

private var outputPlaybackExpectedEndMs: Double = 0

132137

private var lastBargeInAtMs: Double = 0

133138

private var micLogFrameCount = 0

134139

private var micLogByteCount = 0

135140

private var micLogMaxRms: Float = 0

136141

private var lastMicLogAtMs: Double = 0

142+

private var suppressedEchoFrameCount = 0

143+

private var suppressedEchoByteCount = 0

144+

private var suppressedEchoMaxRms: Float = 0

145+

private var lastSuppressedEchoLogAtMs: Double = 0

137146

private var outputAudioChunkCount = 0

138147

private var outputAudioByteCount = 0

139148

@@ -168,7 +177,6 @@ final class RealtimeTalkRelaySession {

168177

let eventStream = await self.gateway.subscribeServerEvents(bufferingNewest: 200)

169178

self.startEventPump(stream: eventStream)

170179

self.configureAudioContract(result.audio)

171-

self.startOutputPlayback()

172180

try self.startMicrophonePump()

173181

self.onStatus("Listening (Realtime)")

174182

} catch {

@@ -219,7 +227,6 @@ final class RealtimeTalkRelaySession {

219227220228

func cancelOutput(reason: String = "user") {

221229

self.stopOutputPlayback()

222-

self.startOutputPlayback()

223230

guard let relaySessionId else { return }

224231

Task { [gateway] in

225232

let payload: [String: Any] = [

@@ -306,12 +313,18 @@ final class RealtimeTalkRelaySession {

306313

let data = Data(base64Encoded: base64)

307314

else { return }

308315

self.recordOutputAudioChunk(byteCount: data.count)

309-

self.markOutputAudioStarted(nowMs: ProcessInfo.processInfo.systemUptime * 1000)

316+

self.markOutputAudioStarted(byteCount: data.count, nowMs: ProcessInfo.processInfo.systemUptime * 1000)

310317

self.onSpeakingChanged(true)

318+

if self.outputContinuation == nil, self.outputTask != nil {

319+

self.pendingOutputChunks.append(data)

320+

return

321+

}

322+

self.ensureOutputPlaybackStarted()

311323

self.outputContinuation?.yield(data)

324+

case "audioDone":

325+

self.finishOutputPlaybackStream()

312326

case "clear":

313327

self.stopOutputPlayback()

314-

self.startOutputPlayback()

315328

case "transcript":

316329

self.handleTranscriptEvent(payload)

317330

case "toolCall":

@@ -337,11 +350,16 @@ final class RealtimeTalkRelaySession {

337350

"talk realtime audio: chunks=\(self.outputAudioChunkCount) bytes=\(self.outputAudioByteCount)")

338351

}

339352340-

private func markOutputAudioStarted(nowMs: Double) {

353+

private func markOutputAudioStarted(byteCount: Int, nowMs: Double) {

341354

if !self.isOutputPlaying {

342355

self.outputStartedAtMs = nowMs

356+

self.outputPlaybackExpectedEndMs = nowMs

343357

}

344358

self.isOutputPlaying = true

359+

let bytesPerSecond = max(1, self.outputSampleRateHz * Double(MemoryLayout<Int16>.size))

360+

let chunkDurationMs = (Double(byteCount) / bytesPerSecond) * 1000

361+

self.outputPlaybackExpectedEndMs = max(nowMs, self.outputPlaybackExpectedEndMs) + chunkDurationMs

362+

self.scheduleOutputPlaybackIdle(expectedEndMs: self.outputPlaybackExpectedEndMs)

345363

}

346364347365

private func handleInputLevelDuringOutput(_ rms: Float, timestampMs: Double) {

@@ -537,14 +555,25 @@ final class RealtimeTalkRelaySession {

537555

{ [weak self, audioSender = self.audioSender] encoded, timestampMs, rms in

538556

guard let audioSender else { return }

539557

Task {

540-

await MainActor.run { [weak self] in

541-

self?.recordMicrophoneFrame(byteCount: encoded.count, rms: rms, timestampMs: timestampMs)

542-

}

543-

if rms >= Self.bargeInRmsThreshold {

544-

await MainActor.run { [weak self] in

545-

self?.handleInputLevelDuringOutput(rms, timestampMs: timestampMs)

558+

let shouldSend = await MainActor.run { [weak self] in

559+

guard let self, !self.isClosed else { return false }

560+

self.recordMicrophoneFrame(byteCount: encoded.count, rms: rms, timestampMs: timestampMs)

561+

self.refreshOutputPlaybackState(timestampMs: timestampMs)

562+

if self.isOutputPlaying {

563+

if self.shouldSuppressMicrophoneDuringOutput() {

564+

self.recordSuppressedOutputEchoFrame(

565+

byteCount: encoded.count,

566+

rms: rms,

567+

timestampMs: timestampMs)

568+

return false

569+

}

570+

if rms >= Self.bargeInRmsThreshold {

571+

self.handleInputLevelDuringOutput(rms, timestampMs: timestampMs)

572+

}

546573

}

574+

return true

547575

}

576+

guard shouldSend else { return }

548577

guard let message = await audioSender.send(encoded, timestampMs: timestampMs) else { return }

549578

await MainActor.run { [weak self] in

550579

guard let self, !self.isClosed else { return }

@@ -561,6 +590,13 @@ final class RealtimeTalkRelaySession {

561590

try self.audioEngine.start()

562591

}

563592593+

private func shouldSuppressMicrophoneDuringOutput() -> Bool {

594+

let outputs = AVAudioSession.sharedInstance().currentRoute.outputs

595+

// Built-in speaker output bleeds into the microphone even in voiceChat mode; keep the

596+

// realtime provider from treating its own speech as user input. Headsets keep barge-in.

597+

return outputs.contains { $0.portType == .builtInSpeaker }

598+

}

599+564600

private func recordMicrophoneFrame(byteCount: Int, rms: Float, timestampMs: Double) {

565601

guard !self.isClosed else { return }

566602

self.micLogFrameCount += 1

@@ -576,42 +612,127 @@ final class RealtimeTalkRelaySession {

576612

self.micLogMaxRms = 0

577613

}

578614615+

private func recordSuppressedOutputEchoFrame(byteCount: Int, rms: Float, timestampMs: Double) {

616+

self.suppressedEchoFrameCount += 1

617+

self.suppressedEchoByteCount += byteCount

618+

self.suppressedEchoMaxRms = max(self.suppressedEchoMaxRms, rms)

619+

guard timestampMs - self.lastSuppressedEchoLogAtMs >= 1000 else { return }

620+

self.lastSuppressedEchoLogAtMs = timestampMs

621+

let maxRms = String(format: "%.4f", Double(self.suppressedEchoMaxRms))

622+

GatewayDiagnostics.log(

623+

"talk realtime mic suppressed during output: "

624+

+ "buffers=\(self.suppressedEchoFrameCount) "

625+

+ "bytes=\(self.suppressedEchoByteCount) maxRms=\(maxRms)")

626+

self.suppressedEchoFrameCount = 0

627+

self.suppressedEchoByteCount = 0

628+

self.suppressedEchoMaxRms = 0

629+

}

630+579631

private func stopMicrophonePump() {

580632

self.audioEngine.inputNode.removeTap(onBus: 0)

581633

self.audioEngine.stop()

582634

}

583635584-

private func startOutputPlayback() {

585-

self.stopOutputPlayback()

636+

private func ensureOutputPlaybackStarted() {

637+

guard self.outputContinuation == nil, self.outputTask == nil else { return }

638+

self.outputSessionId += 1

639+

let sessionId = self.outputSessionId

586640

let stream = AsyncThrowingStream<Data, Error> { continuation in

587641

self.outputContinuation = continuation

588642

}

589643

self.outputTask = Task { [weak self] in

590644

guard let self else { return }

591645

let result = await self.pcmPlayer.play(stream: stream, sampleRate: self.outputSampleRateHz)

592646

await MainActor.run {

647+

guard self.outputSessionId == sessionId else { return }

648+

self.outputTask = nil

649+

self.outputContinuation = nil

593650

if !result.finished, let interruptedAt = result.interruptedAt {

594651

self.logger.info("realtime output interrupted at \(interruptedAt, privacy: .public)s")

595652

}

596653

self.markOutputPlaybackFinished()

654+

self.startPendingOutputPlaybackIfNeeded()

655+

}

656+

}

657+

}

658+659+

private func finishOutputPlaybackStream() {

660+

guard let continuation = self.outputContinuation else {

661+

if self.outputTask != nil, !self.pendingOutputChunks.isEmpty {

662+

self.pendingOutputDone = true

597663

}

664+

return

598665

}

666+

continuation.finish()

667+

self.outputContinuation = nil

599668

}

600669601-

private func markOutputPlaybackFinished() {

670+

private func startPendingOutputPlaybackIfNeeded() {

671+

guard !self.pendingOutputChunks.isEmpty else {

672+

self.pendingOutputDone = false

673+

return

674+

}

675+

let chunks = self.pendingOutputChunks

676+

let shouldFinish = self.pendingOutputDone

677+

self.pendingOutputChunks = []

678+

self.pendingOutputDone = false

679+

self.ensureOutputPlaybackStarted()

680+

for chunk in chunks {

681+

self.markOutputAudioStarted(byteCount: chunk.count, nowMs: ProcessInfo.processInfo.systemUptime * 1000)

682+

self.onSpeakingChanged(true)

683+

self.outputContinuation?.yield(chunk)

684+

}

685+

if shouldFinish {

686+

self.finishOutputPlaybackStream()

687+

}

688+

}

689+690+

private func scheduleOutputPlaybackIdle(expectedEndMs: Double) {

691+

self.outputIdleTask?.cancel()

692+

let nowMs = ProcessInfo.processInfo.systemUptime * 1000

693+

let idleDelayMs = max(350, expectedEndMs - nowMs + 500)

694+

self.outputIdleTask = Task { [weak self] in

695+

try? await Task.sleep(nanoseconds: UInt64(idleDelayMs * 1_000_000))

696+

guard !Task.isCancelled else { return }

697+

await MainActor.run { [weak self] in

698+

guard let self, !self.isClosed else { return }

699+

let nowMs = ProcessInfo.processInfo.systemUptime * 1000

700+

self.refreshOutputPlaybackState(timestampMs: nowMs, cancelIdleTask: false)

701+

}

702+

}

703+

}

704+705+

private func refreshOutputPlaybackState(timestampMs: Double, cancelIdleTask: Bool = true) {

706+

guard self.isOutputPlaying else { return }

707+

guard timestampMs >= self.outputPlaybackExpectedEndMs + 500 else { return }

708+

self.markOutputPlaybackFinished(cancelIdleTask: cancelIdleTask)

709+

}

710+711+

private func markOutputPlaybackFinished(cancelIdleTask: Bool = true) {

712+

if cancelIdleTask {

713+

self.outputIdleTask?.cancel()

714+

self.outputIdleTask = nil

715+

}

602716

self.isOutputPlaying = false

603717

self.outputStartedAtMs = nil

718+

self.outputPlaybackExpectedEndMs = 0

604719

self.onSpeakingChanged(false)

605720

}

606721607722

private func stopOutputPlayback() {

723+

self.outputSessionId += 1

608724

self.outputContinuation?.finish()

609725

self.outputContinuation = nil

610726

self.outputTask?.cancel()

611727

self.outputTask = nil

728+

self.outputIdleTask?.cancel()

729+

self.outputIdleTask = nil

730+

self.pendingOutputChunks = []

731+

self.pendingOutputDone = false

612732

_ = self.pcmPlayer.stop()

613733

self.isOutputPlaying = false

614734

self.outputStartedAtMs = nil

735+

self.outputPlaybackExpectedEndMs = 0

615736

self.onSpeakingChanged(false)

616737

}

617738

@@ -684,7 +805,7 @@ final class RealtimeTalkRelaySession {

684805685806

extension RealtimeTalkRelaySession {

686807

func _test_markOutputAudioStarted(nowMs: Double) {

687-

self.markOutputAudioStarted(nowMs: nowMs)

808+

self.markOutputAudioStarted(byteCount: 4800, nowMs: nowMs)

688809

}

689810690811

func _test_markOutputPlaybackFinished() {