الأكاديمية ← ميزات Hermesتوثيق رسمي · إرشاد عربي

نبضات الجلسة Heartbeats

Session Heartbeats

متوسط3 دقائق قراءةالدرس 43سؤالان✓ 2026-08-18
قبل أن تقرأ

ما هذه الصفحة، وماذا تحتوي.

المهام المجدولة: أن تطلب من Hermes تنفيذ شيء في وقت محدد أو كل يوم، من دون أن تكون حاضرًا. هنا يتحوّل من أداة تسألها إلى مساعد يسبقك: موجز صباحي، متابعة أسبوعية، تنبيه عند تغيّر شيء. القراءة نحو 3 دقائق. انتبه: المهمة التي تعمل وأنت نائم تخطئ وأنت نائم أيضًا. اجعلها تكتب تقريرًا، وجرّبها يدويًا قبل جدولتها.

4أقسام
2أمثلة برمجية
2جداول
0أوامر
483كلمة من المصدر
الوصف الرسمي في سطر

A recurring prompt that re-enters your current session whenever it's idle — /heartbeat every 10m Check the deployment.

ماذا ستستطيع بعدها

نتائج مأخوذة من هذه الصفحة، لا من قالب.

  • تعرف ما المهام المجدولة ولماذا قد تحتاجه.
  • تقرأ الجدول وتأخذ منه السطر الذي يخصّك فقط.
  • تعرف الخطأ الشائع: المهمة التي تعمل وأنت نائم تخطئ وأنت نائم أيضًا. اجعلها تكتب تقريرًا، وجرّبها يدويًا قبل جدولتها.
خريطة الصفحة

انتقل مباشرة إلى ما تحتاجه.

  1. 01Heartbeat vs cron: which one do I want?
  2. 02Commands
  3. 03Behavior details
  4. 04Example
الصفحة الرسمية كاملة

بلا اختصار أو حذف.

النص أدناه منقول من المصدر الرسمي بالإنجليزية حتى تبقى الأوامر والأسماء دقيقة كما هي. قبل كل قسم شرح عربي يوضّح ما بداخله.

/heartbeat gives the current session one recurring instruction. Whenever the session is idle and the interval has elapsed, the prompt fires as a normal user turn — same conversation, same context, same prompt cache.

Textسطر واحد
/heartbeat every 10m Check the deployment and report meaningful changes

Inspired by Prime-Agent's /heartbeat. The Hermes adaptation keeps the strict message-flow invariants: the heartbeat is injected only between turns (never mid-run), as a plain user-role message.

Heartbeat vs cron: which one do I want?

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

They look similar but serve different jobs:

/heartbeathermes cron ↗
Runs inThis conversation — full context, memory of the discussionA fresh isolated session per tick
Survives process restartState survives (SessionDB); firing resumes next time the session is drivenYes — fully durable scheduler
How manyOne per sessionUnlimited jobs
Best for"Keep an eye on X in this thread while we work"Standing jobs, reports, watchdogs, deliveries

Rule of thumb: if the recurring prompt needs the conversation's context, use /heartbeat. If it's a self-contained job, use cron.

Commands

جدول مرجعي. لا تقرأه كله، ابحث عن السطر الذي يخصّك فقط.

CommandWhat it does
/heartbeat every <interval> <prompt>Set (or replace) the session's heartbeat. Intervals: 90s, 10m, 2h, 1d (minimum 60s).
/heartbeat or /heartbeat statusShow the heartbeat, its interval, and time to next fire.
/heartbeat pauseStop firing without clearing.
/heartbeat resumeResume (re-anchors the timer — no instant stale fire).
/heartbeat clearRemove the heartbeat.

/hb is an alias. Works on the CLI and gateway platforms (on Slack, use /hermes heartbeat …).

Behavior details

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه. تذكير: أن تطلب من Hermes تنفيذ شيء في وقت محدد أو كل يوم، من دون أن تكون حاضرًا.

  • Idle-only. A heartbeat never interrupts a running turn. If the agent is busy when the tick comes due, it fires at the next idle poll.
  • Missed ticks coalesce. If the session was busy (or the process wasn't running) through several intervals, you get one heartbeat turn, not a backlog. The timer re-anchors on every fire.
  • User messages win. A queued user message always takes priority; the heartbeat waits for the input queue to drain.
  • Cache-safe. The injected prompt is an ordinary user message. No system-prompt mutation, no toolset change.
  • Persistence. State lives in SessionDB.state_meta keyed by heartbeat:<session_id> — it survives /resume and rides across context-compression session rotations. Firing requires the owning process (CLI session or gateway) to be running; for schedules that must survive anything, use cron.
  • Don't-invent-work guard. The injected prompt tells the agent to reply briefly and stop when nothing meaningful changed, so an idle heartbeat doesn't generate busywork.

Example

شرح للفكرة نفسها. اقرأه ببطء، فبقية الأقسام تبني عليه.

Text9 أسطر
You: /heartbeat every 15m Check whether the CI run for PR #1234 finished; summarize the result when it does

  ♥ Heartbeat set (every 15m): Check whether the CI run for PR #1234 finished; ...

[15 minutes of you working on other things in the same session]

Hermes: [Heartbeat — recurring instruction, fires every 15m]
  💻 gh pr checks 1234   (1.2s)
  CI is still running (14/37 checks complete). Nothing to report yet.

When the answer stops changing, /heartbeat clear it — or let it keep watch.

اختبار الفهم

سؤالان إجاباتها كلها في هذه الصفحة.

كل خيار اسم حقيقي من توثيق Hermes. حتى الخيارات الخاطئة حقيقية، لكنها من صفحات أخرى.

1. في جدول هذا الدرس، ما «/heartbeat» المقابل لـ«Runs in»؟
2. أي عنوان من التالي لا يظهر في هذا الدرس؟