Skip to content

Set x-openclaw-message-channel header for voice requests#13

Open
bonzanni wants to merge 2 commits intotechartdev:mainfrom
bonzanni:main
Open

Set x-openclaw-message-channel header for voice requests#13
bonzanni wants to merge 2 commits intotechartdev:mainfrom
bonzanni:main

Conversation

@bonzanni
Copy link
Copy Markdown

Summary

  • Adds x-openclaw-message-channel: voice to _VOICE_REQUEST_HEADERS in conversation.py

Problem

The OpenClaw gateway injects a channel=webchat value into the agent's Runtime context for all chat completions API requests. This causes the agent to believe it's in a text chat session, even when the request originates from HA Assist voice. The agent sees channel=webchat in its system prompt and ignores voice-specific formatting instructions.

Fix

The OpenClaw gateway supports an x-openclaw-message-channel header that overrides the default channel context. The integration already sends x-openclaw-source: voice and x-ha-voice: true, but these don't change what the agent sees in its Runtime line. Adding x-openclaw-message-channel: voice makes the Runtime show channel=voice, allowing the agent to correctly identify voice sessions and apply TTS-appropriate formatting.

Test plan

  • Start HA Assist voice session → agent Runtime shows channel=voice instead of channel=webchat
  • Agent applies voice-specific skills/formatting when session is voice
  • Non-voice interactions (Lovelace chat card) remain unaffected

A header was missing for properly recognition of the message channel as voice.
Add message channel header for voice requests
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.

1 participant