Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sebslight
Copy link
Member

@sebslight sebslight commented Jan 25, 2026

What

  • Add a strict messages.tts.onlyWhenInboundAudio gate so auto‑TTS only runs when the last inbound message includes audio/voice.
  • Detect inbound audio via MediaType/MediaTypes, <media:audio> placeholder, or [Audio] transcript header and pass that flag into TTS dispatch.
  • Surface the constraint in the TTS system‑prompt hint and document the new flag.
  • Add coverage for the new gating behavior.

Why

We want a hard guarantee that audio replies only happen after an inbound voice note, rather than relying on model behavior.

Decisions

  • Gate at dispatch time (not in the model), using inbound context signals already available.
  • Keep detection conservative: MIME audio/*, <media:audio> placeholders, or [Audio] transcript marker.
  • Default remains off: if onlyWhenInboundAudio is missing, behavior is unchanged (auto‑TTS applies whenever TTS is enabled).
  • Leave manual /tts audio and explicit tool calls unaffected unless TTS is globally enabled; the new flag only gates auto‑TTS.

Testing

  • pnpm test src/tts/tts.test.ts (runs full suite via test-parallel) ❌
    • 5 failures in src/infra/heartbeat-runner.returns-default-unset.test.ts (expected WhatsApp sends were not triggered).
    • src/tts/tts.test.ts itself passes.
  • pnpm lint

@steipete steipete force-pushed the tts-inbound-audio-only branch from 32d370e to 4dfaec9 Compare January 25, 2026 04:35
@steipete steipete merged commit d4f60bf into openclaw:main Jan 25, 2026
21 of 22 checks passed
@steipete
Copy link
Contributor

Landed via temp rebase onto main.

  • Gate: pnpm lint && pnpm build && pnpm test
  • Land commit: ${land_sha}
  • Merge commit: ${merge_sha}

Thanks @sebslight!

jaydenfyi pushed a commit to jaydenfyi/clawdbot that referenced this pull request Jan 25, 2026
mcinteerj pushed a commit to mcinteerj/moltbot that referenced this pull request Jan 25, 2026
rodrigouroz pushed a commit to rodrigouroz/moltbot that referenced this pull request Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants