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

推荐订阅源

F
Fortinet All Blogs
爱范儿
爱范儿
P
Proofpoint News Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
Tailwind CSS Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
Jina AI
Jina AI
B
Blog
N
Netflix TechBlog - Medium
Recent Announcements
Recent Announcements
aimingoo的专栏
aimingoo的专栏
腾讯CDC
C
Check Point Blog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - Franky
罗磊的独立博客
B
Blog RSS Feed
WordPress大学
WordPress大学
小众软件
小众软件
博客园 - 叶小钗
M
MIT News - Artificial intelligence
GbyAI
GbyAI

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: interrupt active discord realtime voice · openclaw/o...
steipete · 2026-05-09 · via Recent Commits to openclaw:main

@@ -594,6 +594,100 @@ describe("DiscordVoiceManager", () => {

594594

);

595595

});

596596597+

it("interrupts realtime playback when an already-active speaker keeps talking", async () => {

598+

const connection = createConnectionMock();

599+

joinVoiceChannelMock.mockReturnValueOnce(connection);

600+

const manager = createManager({

601+

groupPolicy: "open",

602+

allowFrom: ["discord:u1"],

603+

voice: {

604+

enabled: true,

605+

mode: "bidi",

606+

realtime: {

607+

provider: "openai",

608+

bargeIn: true,

609+

providers: {

610+

openai: {

611+

interruptResponseOnInputAudio: false,

612+

},

613+

},

614+

},

615+

},

616+

});

617+618+

await manager.join({ guildId: "g1", channelId: "1001" });

619+620+

const entry = getSessionEntry(manager) as {

621+

realtime?: {

622+

beginSpeakerTurn: (

623+

context: { extraSystemPrompt?: string; senderIsOwner: boolean; speakerLabel: string },

624+

userId: string,

625+

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

626+

};

627+

};

628+

const bridgeParams = createRealtimeVoiceBridgeSessionMock.mock.calls.at(-1)?.[0] as

629+

| {

630+

audioSink?: {

631+

sendAudio: (audio: Buffer) => void;

632+

};

633+

}

634+

| undefined;

635+

const player = getLastAudioPlayer();

636+

const turn = entry.realtime?.beginSpeakerTurn(

637+

{ extraSystemPrompt: undefined, senderIsOwner: true, speakerLabel: "Owner" },

638+

"u1",

639+

);

640+641+

bridgeParams?.audioSink?.sendAudio(Buffer.alloc(480));

642+

turn?.sendInputAudio(Buffer.alloc(3840));

643+644+

expect(realtimeSessionMock.handleBargeIn).toHaveBeenCalled();

645+

expect(player.stop).toHaveBeenCalledWith(true);

646+

expect(realtimeSessionMock.sendAudio).toHaveBeenCalled();

647+

});

648+649+

it("interrupts provider response state even after local realtime playback has ended", async () => {

650+

const manager = createManager({

651+

groupPolicy: "open",

652+

allowFrom: ["discord:u1"],

653+

voice: {

654+

enabled: true,

655+

mode: "bidi",

656+

realtime: {

657+

provider: "openai",

658+

bargeIn: true,

659+

providers: {

660+

openai: {

661+

interruptResponseOnInputAudio: false,

662+

},

663+

},

664+

},

665+

},

666+

});

667+668+

await manager.join({ guildId: "g1", channelId: "1001" });

669+670+

const entry = getSessionEntry(manager) as {

671+

realtime?: {

672+

beginSpeakerTurn: (

673+

context: { extraSystemPrompt?: string; senderIsOwner: boolean; speakerLabel: string },

674+

userId: string,

675+

) => { close: () => void; sendInputAudio: (audio: Buffer) => void };

676+

};

677+

};

678+

const player = getLastAudioPlayer();

679+

const turn = entry.realtime?.beginSpeakerTurn(

680+

{ extraSystemPrompt: undefined, senderIsOwner: true, speakerLabel: "Owner" },

681+

"u1",

682+

);

683+684+

turn?.sendInputAudio(Buffer.alloc(3840));

685+686+

expect(realtimeSessionMock.handleBargeIn).toHaveBeenCalled();

687+

expect(player.stop).toHaveBeenCalledWith(true);

688+

expect(realtimeSessionMock.sendAudio).toHaveBeenCalled();

689+

});

690+597691

it("ignores realtime capture during playback when barge-in is disabled", async () => {

598692

const connection = createConnectionMock();

599693

joinVoiceChannelMock.mockReturnValueOnce(connection);