Move the gateway runtime files into a dedicated core/gateway module and fix follow-up issues in session deletion, history import batching, message IDs, and legacy thread parsing.
Fixes#253
Co-authored-by: Codex <noreply@openai.com>
Add a Convex-backed durable chat layer for companion threads, recover gateway sessions from persisted Pi session files after eviction, and start splitting gateway runtime internals into focused modules.
Co-authored-by: Codex <noreply@openai.com>