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

推荐订阅源

B
Blog
Microsoft Security Blog
Microsoft Security Blog
Jina AI
Jina AI
博客园 - 叶小钗
J
Java Code Geeks
博客园 - 聂微东
博客园 - 司徒正美
大猫的无限游戏
大猫的无限游戏
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
美团技术团队
WordPress大学
WordPress大学
M
MIT News - Artificial intelligence
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
GbyAI
GbyAI
罗磊的独立博客
T
The Blog of Author Tim Ferriss
aimingoo的专栏
aimingoo的专栏
T
Tailwind CSS Blog
The Cloudflare Blog
Stack Overflow Blog
Stack Overflow Blog
N
Netflix TechBlog - Medium
小众软件
小众软件

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

@@ -1201,9 +1201,11 @@ Notes:

1201120112021202

- `voice.tts` overrides `messages.tts` for voice playback only.

12031203

- `voice.mode` controls the conversation path: `stt-tts` keeps the existing batch STT plus TTS flow, `talk-buffer` uses a realtime voice shell for turn timing/transcription/playback while the OpenClaw agent produces the answer, and `bidi` lets the realtime model converse directly while exposing `openclaw_agent_consult` for the OpenClaw brain.

1204+

- `voice.agentSession` controls which OpenClaw conversation receives voice turns. Leave it unset for the voice channel's own session, or set `{ mode: "target", target: "channel:<text-channel-id>" }` to make the voice channel act as the microphone/speaker extension of an existing Discord text channel session such as `#maintainers`.

12041205

- `voice.model` overrides the OpenClaw agent brain for Discord voice responses and realtime consults. Leave it unset to inherit the routed agent model. It is separate from `voice.realtime.model`.

12051206

- In `stt-tts` mode, STT uses `tools.media.audio`; `voice.model` does not affect transcription.

12061207

- In realtime modes, `voice.realtime.provider`, `voice.realtime.model`, and `voice.realtime.voice` configure the realtime audio session. For OpenAI Realtime 2 plus the Codex brain, use `voice.realtime.model: "gpt-realtime-2"` and `voice.model: "openai-codex/gpt-5.5"`.

1208+

- `voice.realtime.bargeIn` controls whether Discord speaker-start events interrupt active realtime playback. If unset, it follows the realtime provider's input-audio interruption setting.

12071209

- For an OpenAI voice on Discord playback, set `voice.tts.provider: "openai"` and choose a Text-to-speech voice under `voice.tts.openai.voice` or `voice.tts.providers.openai.voice`. `cedar` is a good masculine-sounding choice on the current OpenAI TTS model.

12081210

- Per-channel Discord `systemPrompt` overrides apply to voice transcript turns for that voice channel.

12091211

- Voice transcript turns derive owner status from Discord `allowFrom` (or `dm.allowFrom`); non-owner speakers cannot access owner-only tools (for example `gateway` and `cron`).

@@ -1215,6 +1217,7 @@ Notes:

12151217

- `voice.connectTimeoutMs` controls the initial `@discordjs/voice` Ready wait for `/vc join` and auto-join attempts. Default: `30000`.

12161218

- `voice.reconnectGraceMs` controls how long OpenClaw waits for a disconnected voice session to begin reconnecting before destroying it. Default: `15000`.

12171219

- In `stt-tts` mode, voice playback does not stop just because another user starts speaking. To avoid feedback loops, OpenClaw ignores new voice capture while TTS is playing; speak after playback finishes for the next turn. Realtime modes forward speaker starts as barge-in signals to the realtime provider.

1220+

- In realtime modes, echo from speakers into an open mic can look like barge-in and interrupt playback. For echo-heavy Discord rooms, set `voice.realtime.providers.openai.interruptResponseOnInputAudio: false` to keep OpenAI from auto-interrupting on input audio. Add `voice.realtime.bargeIn: true` if you still want Discord speaker-start events to interrupt active playback.

12181221

- `voice.captureSilenceGraceMs` controls how long OpenClaw waits after Discord reports a speaker has stopped before finalizing that audio segment for STT. Default: `2500`; raise this if Discord splits normal pauses into choppy partial transcripts.

12191222

- When ElevenLabs is the selected TTS provider, Discord voice playback uses streaming TTS and starts from the provider response stream. Providers without streaming support fall back to the synthesized temp-file path.

12201223

- OpenClaw also watches receive decrypt failures and auto-recovers by leaving/rejoining the voice channel after repeated failures in a short window.

@@ -1230,6 +1233,24 @@ STT plus TTS pipeline:

12301233

- `voice.model`, when set, overrides only the response LLM for this voice-channel turn.

12311234

- `voice.tts` is merged over `messages.tts`; streaming-capable providers feed the player directly, otherwise the resulting audio file is played in the joined channel.

123212351236+

Default voice-channel session example:

1237+1238+

```json5

1239+

{

1240+

channels: {

1241+

discord: {

1242+

voice: {

1243+

enabled: true,

1244+

mode: "stt-tts",

1245+

model: "openai/gpt-5.4-mini",

1246+

},

1247+

},

1248+

},

1249+

}

1250+

```

1251+1252+

With no `voice.agentSession` block, each voice channel gets its own routed OpenClaw session. For example, `/vc join channel:234567890123456789` talks to the session for that Discord voice channel.

1253+12331254

Realtime talk-buffer example:

1234125512351256

```json5

@@ -1274,6 +1295,79 @@ Realtime bidi example:

12741295

}

12751296

```

127612971298+

Voice as an extension of an existing Discord channel session:

1299+1300+

```json5

1301+

{

1302+

channels: {

1303+

discord: {

1304+

voice: {

1305+

enabled: true,

1306+

mode: "bidi",

1307+

model: "openai-codex/gpt-5.5",

1308+

agentSession: {

1309+

mode: "target",

1310+

target: "channel:123456789012345678",

1311+

},

1312+

realtime: {

1313+

provider: "openai",

1314+

model: "gpt-realtime-2",

1315+

voice: "cedar",

1316+

toolPolicy: "safe-read-only",

1317+

consultPolicy: "always",

1318+

},

1319+

},

1320+

},

1321+

},

1322+

}

1323+

```

1324+1325+

In this mode the bot joins the configured voice channel, but OpenClaw agent turns use the target channel's normal routed session and agent. The realtime voice session speaks the returned result back into the voice channel. The supervisor agent can still use normal message tools according to its tool policy, including sending a separate Discord message if that is the right action.

1326+1327+

Useful target forms:

1328+1329+

- `target: "channel:123456789012345678"` routes through a Discord text channel session.

1330+

- `target: "123456789012345678"` is treated as a channel target.

1331+

- `target: "dm:123456789012345678"` or `target: "user:123456789012345678"` routes through that direct-message session.

1332+1333+

Echo-heavy OpenAI Realtime example:

1334+1335+

```json5

1336+

{

1337+

channels: {

1338+

discord: {

1339+

voice: {

1340+

enabled: true,

1341+

mode: "bidi",

1342+

model: "openai-codex/gpt-5.5",

1343+

realtime: {

1344+

provider: "openai",

1345+

model: "gpt-realtime-2",

1346+

voice: "cedar",

1347+

bargeIn: true,

1348+

consultPolicy: "always",

1349+

providers: {

1350+

openai: {

1351+

interruptResponseOnInputAudio: false,

1352+

},

1353+

},

1354+

},

1355+

},

1356+

},

1357+

},

1358+

}

1359+

```

1360+1361+

Use this when the model hears its own Discord playback through an open mic, but you still want to interrupt it by speaking. OpenClaw keeps OpenAI from auto-interrupting on raw input audio, while `bargeIn: true` lets Discord speaker-start events cancel active playback and start the next captured turn.

1362+1363+

Expected voice logs:

1364+1365+

- On join: `discord voice: joining ... voiceSession=... supervisorSession=... agentSessionMode=... voiceModel=... realtimeModel=...`

1366+

- On realtime start: `discord voice: realtime bridge starting ... interruptResponse=false bargeIn=true`

1367+

- On realtime consult: `discord voice: realtime consult requested ... voiceSession=... supervisorSession=... question=...`

1368+

- On agent answer: `discord voice: agent turn answer ...`

1369+

- On disabled barge-in: `discord voice: realtime capture ignored during playback (barge-in disabled) ...`

1370+12771371

Credentials are resolved per component: LLM route auth for `voice.model`, STT auth for `tools.media.audio`, TTS auth for `messages.tts`/`voice.tts`, and realtime provider auth for `voice.realtime.providers` or the provider's normal auth config.

1278137212791373

### Voice messages