Repository navigation
feat(inbound-meta): expose per-turn source modality - #93754
Merged
vincentkoc merged 2 commits intoJun 16, 2026
Merged
Conversation
…ixes openclaw#50482) Add resolveInboundMessageType() that extracts the media type prefix (e.g. 'audio' from 'audio/ogg') from MediaType or MediaTypes fields. Expose it as message_type in the inbound metadata JSON so agents can distinguish voice messages from typed text for turn-completion heuristics.
vincentkoc
force-pushed
the
fix/expose-voice-message-type-v3
branch
from
June 16, 2026 21:05
20d1a2e to
33f0055
Compare
Member
|
Maintainer repair and land-ready verification complete.
Known proof gap: no live Telegram account was used. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jun 17, 2026
* feat(inbound-meta): expose message_type in trusted inbound metadata (fixes openclaw#50482) Add resolveInboundMessageType() that extracts the media type prefix (e.g. 'audio' from 'audio/ogg') from MediaType or MediaTypes fields. Expose it as message_type in the inbound metadata JSON so agents can distinguish voice messages from typed text for turn-completion heuristics. * fix(inbound-meta): preserve per-turn source modality --------- Co-authored-by: Vincent Koc <[email protected]>
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
SourceModalitythrough the shared channel event context.voicewithout treating ordinary audio attachments as voice notes.source_modalityin dynamic per-turn conversation metadata, with bounded MIME-derived fallback for channels that only provide media types.Fixes #50482
Verification
node scripts/run-vitest.mjs src/auto-reply/reply/inbound-meta.test.ts src/channels/inbound-event/context.test.ts extensions/telegram/src/bot-message-context.dm-topic-threadid.test.ts.agents/skills/autoreview/scripts/autoreview --mode branch --base origin/mainOPENCLAW_TESTBOX=1 node scripts/crabbox-wrapper.mjs run --provider blacksmith-testbox -- env OPENCLAW_CHECK_CHANGED_REMOTE_CHILD=1 OPENCLAW_CHANGED_LANES_RAW_SYNC=1 corepack pnpm check:changedReal behavior proof
Behavior addressed: Telegram voice-note origin remains distinguishable after transcription and is exposed to the agent on every turn.
Real environment tested: OpenClaw Telegram inbound context and agent prompt boundary in the repository test harness.
Exact steps or command run after this patch: Ran the focused Telegram, channel-context, and inbound-metadata Vitest shards listed above.
Evidence after fix: The Telegram context test proves
msg.voiceproducesSourceModality: "voice"while ordinarymsg.audiodoes not; the inbound metadata test provessource_modality: "voice"reaches per-turn conversation metadata.Observed result after fix: Voice-note provenance survives shared context normalization and resumed-session prompt construction.
What was not tested: A live Telegram account sending a real voice note.