mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-18 18:29:35 +08:00
6c26f3ef08
Inbound: src/index.ts onInbound stamps `instance: adapter.instance ?? adapter.channelType` — the single host-side stamping seam; adapters stay instance-blind and onInboundEvent (CLI) passes events through unchanged. The router resolves the thread-policy adapter and the messaging group by the receiving instance (exact-only — an unknown named instance auto-creates its own group, persisting the instance, instead of hijacking a sibling's row). Outbound: ChannelDeliveryAdapter.deliver/setTyping grow a trailing `instance` param (host-internal interface only — messages_out, destinations and session_routing schemas are untouched; containers never see instance). deliverMessage resolves the messaging group ORIGIN-SESSION-FIRST, so a named instance's session replies through its own adapter even when a sibling default row shares the same (channel_type, platform_id); dispatch goes through getChannelAdapter(instance ?? channelType). Typing: TypingTarget stores the instance and all three tick sites (immediate, 4s interval, re-trigger) forward it, so the indicator fires through the bot that owns the chat. Also updates a raw-SQL fixture in groups.test.ts for the NOT NULL instance column. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>