IncomingMessage

The normalized provider message passed to Channels handlers, including user, multimodal parts, and managed correlation ids.


IncomingMessage is the normalized inbound turn passed to onMessage, onMention, tools, and interaction contexts.

Shape

interface IncomingMessage {
  text: string;
  user: ApplicationUser | null;
  actor: ProviderActor;
  ref: MessageRef;
  platform: string;
  contentParts?: AgentContentPart[];
  eventId?: string;
  turnId?: string;
  deliveryId?: string;
}
FieldManaged Slack and Teams behavior
textProvider text after ingress normalization.
userNullable application user returned by the Channel's identifyUser policy.
actorProvider account that caused the event. It includes a required actor kind.
refIn ordinary message handlers this may have an empty id; do not assume every inbound turn can be edited.
platformNative source: "slack" or "teams" for message deliveries.
contentPartsHydrated file/media parts when attachments were retrieved.
eventIdStable provider-event id for application idempotency.
turnIdManaged turn correlation id.
deliveryIdManaged lease/delivery correlation id.

Multimodal prompt

const prompt = message.contentParts?.length
  ? [
      ...(message.text ? [{ type: "text" as const, text: message.text }] : []),
      ...message.contentParts,
    ]
  : message.text;

await thread.runAgent({ prompt });

Managed history excludes the current inbound turn. runAgent() injects the message automatically when prompt is omitted; use the explicit combined prompt above when a turn can contain both text and attachments. See Files and multimodal input.