Set x-openclaw-message-channel header for voice requests#13
Open
bonzanni wants to merge 2 commits intotechartdev:mainfrom
Open
Set x-openclaw-message-channel header for voice requests#13bonzanni wants to merge 2 commits intotechartdev:mainfrom
bonzanni wants to merge 2 commits intotechartdev:mainfrom
Conversation
A header was missing for properly recognition of the message channel as voice.
Add message channel header for voice requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
x-openclaw-message-channel: voiceto_VOICE_REQUEST_HEADERSinconversation.pyProblem
The OpenClaw gateway injects a
channel=webchatvalue 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 seeschannel=webchatin its system prompt and ignores voice-specific formatting instructions.Fix
The OpenClaw gateway supports an
x-openclaw-message-channelheader that overrides the default channel context. The integration already sendsx-openclaw-source: voiceandx-ha-voice: true, but these don't change what the agent sees in its Runtime line. Addingx-openclaw-message-channel: voicemakes the Runtime showchannel=voice, allowing the agent to correctly identify voice sessions and apply TTS-appropriate formatting.Test plan
channel=voiceinstead ofchannel=webchat