ИИ-автоматизация 2 июня 2026 г.

Telegram на телефоне, Discord на рабочем столе: Gateway Hermes Agent для always-on multi-device ИИ (2026)

NodeMac Команда

~14 мин

You kick off a batch HTML landing-page generation from Telegram on the subway. You lock your phone, switch apps, or lose signal—and with a browser chat tab, the run would die and your context would evaporate. That is the 2026 pain for solo hackers and developers who remote-control agents from mobile but need work to continue on an always-on host.

Hermes Agent from Nous Research solves this with a single Gateway process: one long-lived daemon on your Mac or VPS that connects to Telegram, Discord, Slack, WhatsApp, Signal, Email, and more via platform adapters and webhooks. The agent loop runs on the server, not in your phone browser. Sessions persist in a per-chat store until you /reset or idle-timeout—default idle reset is 1440 minutes (24 hours) per upstream docs, configurable per platform in ~/.hermes/gateway.json.

This guide focuses on Hermes Agent Gateway configuration for cross-device flow: start a long task from Telegram, walk into the office, open Discord, and pick up files, background results, and named sessions from the same gateway. For install prerequisites, see our руководство по настройке Hermes macOS; for parallel subagent workers, see делегирование subagent Hermes. Low NodeMac pitch—upstream paths only.

Hermes Agent Gateway multi-device Telegram Discord setup
Disclosure: NodeMac publishes Mac automation guides and offers Mac hosting. This article documents upstream Hermes Gateway behavior from the Messaging Gateway docs; platform lists and defaults may change between releases.

Почему вкладки браузера падают, а Gateway выживает

Failure modeWeb chat / local scriptHermes Gateway on always-on host
Phone app backgroundedSSE/WebSocket often dropsGateway process keeps running
Laptop lid closedProcess suspendedlaunchd/systemd keeps gateway alive
Long tool run (30+ min)Tab timeout, lost contextAgent loop on server; optional /background
Switch Telegram → DiscordN/A (different products)Same gateway, shared workspace + memory
Cron / scheduled jobsRequires separate schedulerBuilt-in cron ticks every 60 seconds inside gateway

Quotable: Hermes Gateway is one background process that connects all configured platforms, routes each message through a per-chat session store, dispatches to AIAgent, and runs the cron scheduler—upstream architecture docs, June 2026.

Source: Hermes Messaging Gateway.

Архитектура Gateway: adapters, sessions, webhooks

                    ┌─────────────────────────────────────┐
Telegram webhook ──►│  Hermes Gateway (single process)     │
Discord gateway ──►│  ├─ Platform adapters                │
Slack events    ──►│  ├─ Per-chat session store           │
                    │  ├─ AIAgent tool loop (server-side)  │
                    │  ├─ Cron scheduler (60s tick)        │
                    │  └─ ~/.hermes/ state + workspace     │
                    └─────────────────────────────────────┘
                              │
                    Files, memory, skills on disk
                              │
         Phone (Telegram)          Desktop (Discord)
         same user, different       reads outputs / /resume
         chat sessions              named session

Each platform adapter receives inbound messages (Telegram bot API, Discord gateway events, Slack webhooks), maps them to a session key (platform + chat ID), and enqueues agent turns. Tool progress can stream back to the chat (display.tool_progress: all in ~/.hermes/config.yaml).

Important nuance for cross-device UX: Telegram DM and Discord DM are separate sessions by default—they do not magically mirror every message. Continuity comes from three mechanisms working together:

  1. /background — Fire-and-forget tasks; results deliver to the chat where you started the command, while your main session stays responsive.
  2. Shared workspace — Generated HTML, logs, and artifacts land on the gateway host filesystem; any platform can ask the agent to read them.
  3. /title + /resume — Name a session on Telegram, resume the named session from Discord (same gateway user).

Configure longer idle resets so a commute does not wipe context:

{
  "reset_by_platform": {
    "telegram": { "mode": "idle", "idle_minutes": 480 },
    "discord": { "mode": "idle", "idle_minutes": 240 }
  }
}

Path: ~/.hermes/gateway.json per session management docs.

Сценарий: метро Telegram → office Discord

Goal: From Telegram mobile, assign "Generate 5 HTML landing page variants in ~/projects/landing-batch/". At the desk, Discord shows progress and file previews.

Recommended path:

StepWhereAction
1Server (once)Gateway running 24/7 via hermes gateway install + launchd
2Telegram/background Build 5 HTML landing variants in ~/projects/landing-batch/ using brand colors from MEMORY.md
3TelegramGateway ack: Task ID: bg_HHMMSS_xxxx — phone can lock
4Discord/resume landing-batch if you /title landing-batch first, OR ask: List files in ~/projects/landing-batch and summarize
5DiscordEnable display.tool_progress: all to see tool status during active turns
6Either/status shows session info; /platform list shows adapter health

For live streaming in Discord while the task runs, start the job in Discord with display.busy_input_mode: queue so follow-ups queue instead of interrupting—or run the heavy work via /background on Telegram and poll from Discord using filesystem tools.

Pair with делегирование subagent Hermes when one landing page needs parallel research + codegen subagents; Gateway delivers human messages, delegation handles fan-out.

Пошаговая настройка Gateway

1. Install Hermes

If missing: curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash, then hermes doctor. Details: руководство по настройке Hermes macOS.

2. Run gateway wizard

hermes gateway setup

Walk through Telegram bot token (from @BotFather), Discord bot token + intents, allowlists. Upstream recommends DM pairing or TELEGRAM_ALLOWED_USERS / DISCORD_ALLOWED_USERS—never GATEWAY_ALLOW_ALL_USERS=true on bots with terminal access.

3. Approve your phone Telegram user

hermes pairing approve telegram XKGH5N7P

4. Install gateway as a persistent service

hermes gateway install
hermes gateway start
hermes gateway status

Equivalent to launchd plist under ~/Library/LaunchAgents/ per upstream; logs in ~/.hermes/logs/.

5. Configure display + session policy

display:
  tool_progress: all
  busy_input_mode: queue
  busy_ack_enabled: true

Edit ~/.hermes/gateway.json for idle timeouts (JSON block in architecture section).

6. Set Discord home channel

/sethome

Circuit-breaker trip notifications and gateway restart messages route to configured home_chat_id per platform.

7. Test cross-device handoff

Telegram: /title commute-test then start a 2-minute task. Discord: /resume commute-test. If empty, verify same allowed user ID on both platforms.

8. Harden for production

gateway:
  platforms:
    discord:
      extra:
        allow_from: ["YOUR_DISCORD_USER_ID"]
        allow_admin_from: ["YOUR_DISCORD_USER_ID"]
    telegram:
      extra:
        allow_from: ["YOUR_TELEGRAM_USER_ID"]

Restart: hermes gateway stop && hermes gateway start or launchctl kickstart -k gui/$(id -u)/com.hermes.gateway.

Hardware note: Apple Mac mini specifications list 16 GB base RAM—enough for gateway + one active agent; 24 GB if you add subagents or MCP servers concurrently.

Устранение неполадок

Gateway running but Telegram bot silent

Symptom: hermes gateway status shows running; DMs never reply.

Fix: Complete DM pairing (hermes pairing list). Confirm bot token in env survived launchd—launchctl print gui/$(id -u)/com.hermes.gateway | grep -i telegram. Restart gateway after token changes.

Discord connects but no message streaming

Symptom: Final answers appear; no tool progress lines.

Fix: Set display.tool_progress: all in ~/.hermes/config.yaml. Enable Message Content Intent in Discord Developer Portal.

/platform list shows adapter paused-by-breaker

Symptom: One platform stops after repeated API errors.

Fix: Check ~/.hermes/logs/gateway.log. Wait for upstream recovery, then /platform resume telegram. Breakers do not auto-resume by design.

Background task finished but Discord sees nothing

Symptom: Telegram received background complete; Discord empty.

Expected behavior: Background results deliver to the originating chat. From Discord, run /status or ask the agent to read output paths.

Gateway vs CLI: when to use which

Use CLI (hermes)Use Gateway
Local debugging, slash command devMobile + multi-platform access
Ephemeral experiments24/7 cron + messaging delivery
No bot tokens neededTelegram/Discord/Slack integration

Both share ~/.hermes/ memory, skills, and model config—/model works on either surface per CLI vs Messaging quick reference.

FAQ

Синхронизирует ли Hermes Gateway Telegram и Discord автоматически?

Нет как одно зеркало. У каждой платформы+чата свой session store. Непрерывность через общий workspace, memory, /background и /title + /resume.

Что при блокировке телефона?

Gateway продолжает на хосте. /background или busy_input_mode: queue.

Сколько платформ на один Gateway?

20+ адаптеров upstream; обычно 2–3. /platform list.

Нужен ли облачный Mac?

Нужен always-on хост. Спящий ноутбук паузит доставку.

Чем отличается от macOS setup?

Setup = install, tokens, launchd. Эта статья = multi-device, handoff, Telegram+Discord.

Нужен постоянно включённый Mac для Hermes Gateway 24/7?

Выделенные Mac на Apple Silicon с SSH в HK, JP, SG, KR и US.

NM
NodeMac Cloud Mac
Развёртывание 5 мин

Аренда Mac на Apple Silicon. SSH/VNC, HK·JP·SG·KO·US.

Начать