Skip to content

Feature Request: Structured inbound/outbound message schema beyond plain text #2

@yidianyiko

Description

@yidianyiko

Summary

ClawScale currently appears to route messages primarily as plain text content. For many production messaging use cases, a gateway needs a richer canonical message schema.

Problem

A text-only abstraction is too narrow for modern IM gateway use cases.

Important message features usually include:

  • images
  • audio / voice notes
  • files / documents
  • quoted replies / references
  • group metadata
  • thread metadata
  • sender metadata
  • platform-specific delivery fields

Without a structured canonical schema, each adapter ends up handling message features ad hoc, and external backends cannot reliably consume or produce richer message types.

Proposed solution

Introduce a canonical message envelope for both inbound and outbound flows.

Example top-level fields:

  • id
  • channelId
  • conversationId
  • sender
  • recipient
  • chatType (direct / group)
  • threadId
  • replyTo
  • parts[]
  • metadata

Where parts[] can support:

  • text
  • image
  • audio
  • video
  • file
  • location
  • contact
  • sticker
  • system

Each part should include normalized metadata plus adapter-specific raw metadata where necessary.

Expected behavior

  • Adapters map provider-native messages into a canonical schema
  • Backends can receive structured messages, not only flattened text
  • Outbound sends can specify structured content
  • Quoted replies and media attachments are preserved when possible
  • Group and thread metadata are available consistently

Why this matters

A richer schema makes ClawScale much more viable as a long-term gateway layer, especially for systems that need multimodal chat, quoted replies, and reliable cross-channel behavior.

Acceptance criteria

  • A documented canonical message schema exists
  • At least text, image, audio, file, and reply/reference are supported
  • Inbound adapters emit structured payloads
  • Outbound APIs can accept structured payloads
  • Unsupported channel features degrade predictably and are documented

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions