Skip to content

Session Routing

Gateway routes each external conversation to a real DuckAgent session.

The route key includes:

  • Channel name.
  • Conversation, chat, room, group, or channel id.
  • Thread, topic, or message-thread id when the platform has one.

This prevents collisions such as Telegram chat-a, Lark chat-a, and two topics inside the same group sharing one session by accident.

Gateway mappings live in:

~/.duckagent/profiles/<name>/gateway/state/sessions.jsonl

Full messages live in the normal session directory:

~/.duckagent/profiles/<name>/sessions/<session-id>/messages.jsonl

Gateway mapping state is append-only. /new and /resume append new route mappings instead of editing old records.

/new
/resume
/resume <number>
/rewind
/rewind <number>

/rewind appends a session rewind event and can restore tracked file snapshots from built-in file mutation tools when the current file checksum still matches the recorded after-state. See Session Rewind.