Skip to content

Feature: Cross-Platform Session Handoff (CLI ↔ Telegram ↔ iMessage) #8366

@onssoo

Description

@onssoo

Problem

When using Hermes across multiple platforms (CLI at desk, Telegram on the go, iMessage), each platform has its own isolated session with no continuity.

Common scenario:

  1. Working on something in the CLI at home
  2. Need to leave — commute, errands, etc.
  3. Want to continue the same work via Telegram on the phone
  4. Later, back at desk, want to resume on CLI

Currently this is impossible. Each platform starts a fresh session with no awareness of what was being worked on elsewhere.

Current Behavior

  • Session keys are platform-specific: agent:main:cli, agent:main:telegram:dm:XXXXX, etc.
  • Session transcripts are stored separately per platform
  • No mechanism to transfer context between platforms
  • The session_reset policy controls idle timeout per platform, but there is no cross-platform state

Proposed Behavior

A built-in "handoff" mechanism that lets users seamlessly continue work across platforms:

[CLI] User: "save state, heading out"
Hermes: *writes state snapshot*

[Telegram] User: "continue"  
Hermes: "Picking up from where you left off on CLI. We were..."

What "state" should include:

  • Current task description (2-3 sentences)
  • Progress so far (completed steps)
  • Key context (file paths, commands run, important values)
  • Next steps
  • Open questions

How it should work:

  1. Manual save: User says "save state" or "switch to telegram" → snapshot written to a known file
  2. Auto-detect: When a new session starts on any platform, check for saved state and offer to load it
  3. Cross-platform awareness: Session store could track which platforms have active sessions for the same user, enabling smarter handoffs

Implementation Ideas

Minimal (skill-level, what we built as a workaround):

  • Save state to ~/.hermes/session_state.md
  • Add instructions in SOUL.md to check for this file at session start
  • Delete after loading to prevent stale state

Limitations: Relies on LLM following instructions consistently. No auto-detection of platform switches. No structured data.

Better (built-in):

  • Add a session_handoff tool or slash command (/handoff)
  • Gateway tracks active sessions per user across platforms
  • On handoff, compress current session transcript and store as a portable context block
  • New platform session loads the context block as an ephemeral system prompt injection
  • Structured handoff data (JSON) instead of free-text markdown

Best (deep integration):

  • Session store is user-centric, not platform-centric
  • Context compression produces a portable "continuation token"
  • When user starts typing on a different platform, gateway detects the switch and offers: "Continue your session from Telegram?"
  • Automatic state sync — no manual save/load needed

Why This Matters

Telegram is one of the most popular Hermes interfaces. The typical workflow is:

Desk (CLI) → Phone (Telegram/iMessage) → Desk (CLI)

This is not an edge case — it is the primary remote access pattern. Without session handoff, users lose all context when switching platforms, which breaks the "AI assistant that follows you everywhere" promise.

Environment

  • macOS, Hermes latest
  • Platforms: CLI + Telegram (via SOCKS5 proxy)
  • Session reset: 72h idle / daily at 4 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/gatewayGateway runner, session dispatch, deliveryplatform/telegramTelegram bot adaptertype/featureNew feature or request

    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