feat(session): add /handoff command for cross-platform session transfer#22726
feat(session): add /handoff command for cross-platform session transfer#22726kshitijk4poor wants to merge 1 commit into
Conversation
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-import |
1 |
First entries
tests/hermes_cli/test_session_handoff.py:8: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
✅ Fixed issues: none
Unchanged: 4175 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
Adds /handoff <platform> CLI command that queues the current session for resume on the configured home channel of any messaging platform. CLI side: - /handoff telegram — marks session in shared DB, sends summary to the Telegram home channel via send_message - /handoff discord — same for Discord - Supports telegram, discord, slack, whatsapp, signal, matrix Gateway side: - On new session creation, checks for pending handoffs for the incoming message's platform - If found, loads the CLI session's full conversation history and injects it into the context prompt as a handoff transcript - Agent continues the conversation seamlessly Files: - hermes_state.py: handoff_pending, handoff_platform columns + helpers - cli.py: _handle_handoff_command dispatch + handler - hermes_cli/commands.py: CommandDef entry - gateway/run.py: handoff detection in _handle_message_with_agent - tests/hermes_cli/test_session_handoff.py: 8 tests
b87875f to
a52c204
Compare
|
Merged via #23395 — your commit (ea0f4d4) was cherry-picked onto current main with your authorship preserved in git log, then I rewrote the gateway-side flow on top so the handoff happens immediately rather than waiting for a real user message. The |
What
Adds
/handoff <platform>— a CLI slash command that hands your current session off to a messaging platform's home channel. The session becomes available on that platform and continues with full conversation context.How
Files (5 files, +297 lines)
hermes_state.pyhandoff_pending+handoff_platformcolumns (declarative, auto-migrates), 3 helper methodscli.py_handle_handoff_command— marks session, sends notification via send_messagehermes_cli/commands.pyCommandDefentrygateway/run.py_handle_message_with_agent— checks for pending handoffs on new sessions, injects transcripttests/hermes_cli/test_session_handoff.pySupported platforms
telegram, discord, slack, whatsapp, signal, matrix
Architecture rationale
No identity binding, no tokens, no QR codes. The gateway's configured home channel IS the authority. This follows the same pattern as all cloud-backed tools (ChatGPT, Claude Code) but uses Hermes's existing gateway identity layer instead of a cloud account.