자동화, Cron, Goals
기준일: 2026-07-26
난이도: 중급
공식 기준: Cron Jobs, Persistent Goals, Hooks
Hermes 자동화는 스케줄 실행(cronjob / hermes cron / /cron)과 세션 내 장기 목표(/goal)로 나뉩니다. 실패 시 누가, 어디서, 어떤 권한으로 복구할지를 먼저 정합니다.
핵심 개념
| 기능 | 적합한 작업 | 주요 표면 |
|---|---|---|
| cron | 정해진 시각 리포트·모니터링 | cronjob tool, hermes cron, /cron, gateway scheduler |
| persistent goals | 성공할 때까지 여러 턴 추적 (Ralph 스타일) | /goal, goals.max_turns, auxiliary.goal_judge |
| hooks | 이벤트 반응 로깅·알림 | Hooks 문서 lifecycle |
| no-agent cron | LLM 없이 스크립트 stdout 전달 | no_agent=True, --no-agent |
Cron 실행은 gateway daemon이 약 60초 tick으로 ~/.hermes/cron/jobs.json을 처리합니다. Cron 세션 안에서는 cron 관리 도구가 꺼져 recursive schedule loop를 막습니다.
선택 기준
- “매일 아침 요약” → cron
- “테스트 통과할 때까지 계속” →
/goal - “스크립트만 돌리고 이상 시 알림” → no-agent cron
- “도구 전후 기록” → hooks
- 파일 수정 자동화 → sandbox / worktree 정책을 먼저
실습
Cron — 생성
채팅:
/cron add 30m "Remind me to check the build"
/cron add "every 2h" "Check server status"
/cron add "every 1h" "Summarize new feed items" --skill blogwatcher
CLI:
hermes cron create "every 2h" "Check server status"
hermes cron create "every 1h" "Summarize new feed items" --skill blogwatcher
hermes cron create "every 1d at 09:00" \
"Audit open PRs, summarize CI health" \
--workdir /home/me/projects/acme
스케줄 형식 예: 30m, every 2h, 0 9 * * *, ISO timestamp.
Cron — 수명 주기
hermes cron list
hermes cron pause <job_id_or_name>
hermes cron resume <job_id_or_name>
hermes cron run <job_id_or_name>
hermes cron remove <job_id_or_name>
hermes cron edit <job_id_or_name> --schedule "every 4h"
hermes cron status
hermes cron runs [job-id] --limit 20
에이전트 도구 액션: create | list | update | pause | resume | run | remove.
주요 설정·키
| 키 / 옵션 | 용도 |
|---|---|
deliver |
origin, local, telegram, discord:#eng, all, 콤마 목록 등 |
workdir |
프로젝트 절대 경로; context 파일·terminal cwd 기준 (workdir job은 tick 내 직렬) |
enabled_toolsets |
작업별 toolset 제한 (예: ["web","file"]) |
context_from |
선행 job 최근 출력을 다음 prompt 앞에 주입 |
script + no_agent |
~/.hermes/scripts/ 스크립트, stdout 전달 / 빈 stdout silent |
cron.wrap_response |
전달 메시지 헤더 래핑 on/off |
cron.mirror_delivery |
전달을 대화에 붙여 continuable |
cron.script_timeout_seconds / HERMES_CRON_SCRIPT_TIMEOUT |
pre-run script 한도 (기본 3600s) |
TELEGRAM_CRON_THREAD_ID |
Telegram cron 전용 topic |
| 미pin provider/model | 생성 시 글로벌 스냅샷; 이후 글로벌 변경 시 fail-closed 알림 → update로 pin |
Gateway:
hermes gateway install
hermes gateway
Silent 모니터링: 성공 응답에만 [SILENT]이면 전달 억제(실패는 항상 전달).
Goals
/goal Fix every failing test in tests/hermes_cli/ and make sure scripts/run_tests.sh passes
/goal draft Migrate the auth service from session cookies to JWT
/goal status
/goal pause
/goal resume
/goal clear
/goal show
/subgoal add a regression test for the bug you just patched
# ~/.hermes/config.yaml
goals:
max_turns: 20
auxiliary:
goal_judge:
provider: openrouter
model: google/gemini-3-flash-preview
Completion contract 필드(선택): outcome, verification, constraints, boundaries, stop_when. 인라인 verify: / constraints: 등 접두사 또는 /goal draft. 백그라운드 프로세스 대기: 판정이 wait 하거나 /goal wait <pid>.
Hermes에 입력할 프롬프트
다음 자동화를 cron /goal /no-agent cron /수동으로 분류하고,
cron이면 schedule·deliver·workdir·enabled_toolsets·실패 알림까지 초안을 만들어줘.
- 매일 오전 릴리스 노트 요약 → Telegram
- 빌드 통과할 때까지 수정 반복
- RAM 85% 초과 시만 알림 (스크립트)
체크리스트
- gateway가 떠 있고
hermes cron status가 정상이다. - unattended job에 provider/model pin 또는 스냅샷 정책을 이해했다.
- deliver 대상과
[SILENT]/ no-agent 패턴을 검증했다. -
/goal에 검증 가능한 완료 조건(또는 contract)을 넣었다. - 파일 수정 자동화의 sandbox·workdir 경계를 정했다.