소스 정보
- 저장소
- lukemcqueen/hermes-cortex
- 최근 소스 활동
- 2026년 8월 18일 19:45
- 감지된 SKILL.md 언어
- 영어
- 스타
- 4
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/lukemcqueen/hermes-cortex --skill detached-worker-pattern명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| name | detached-worker-pattern |
| description | Cron tick budget kill: detached worker + result sweep. |
| version | 1.0.0 |
| category | devops |
| metadata | {"hermes":{"tags":["cron","background","worker","timeout","at-least-once","result-receipt","deadlock","decouple"],"related_skills":["cron-job-management","fleet-commands"]}} |
Any budgeted, at-least-once consumer (a cron tick, a message handler tick, a job queue worker) that must run work whose worst-case runtime can exceed the consumer's execution budget:
HERMES_CRON_TIMEOUT, no_agent script
limits) running subprocess chains (pull + deploy + doctor ≈ 390s worst case
inside a 300s budget)Fleet UPDATE_REQUEST dispatch: 5 hosts consumed the request and the updates
LANDED (verified via direct probes: repo + deploy sync at the target SHA), but
0/5 returned UPDATE_RESULTs. Root cause: the handler ran
pull+cortex-update+doctor synchronously (~390s worst case) inside a cron tick
budgeted at ~300s. The tick was killed mid-processing — after the early-archive
— so the request was never re-processed and the receipt was silently lost.
"Consumed but no result" looked like a bus failure; it was an execution-budget
kill.
subprocess.Popen(
[sys.executable, "-c", WORKER_CODE, handler_path, json.dumps(msg_body), corr],
start_new_session=True, # survives the parent's budget kill
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
)
start_new_session=True detaches from the parent's process group so the
cron's kill (which targets the tick's group) cannot take the worker down.state/pending-results/<corr>.json — never sends over the bus itself.<corr>.json when done (success OR crash — wrap in try/except
so a crash still yields a structured error result).<corr>.running when spawning; worker deletes it on finish.
The marker also tells concurrent readers "a deploy is mid-flight" — see #4.for f in sorted(PENDING_DIR.glob("*.json")):
result = json.loads(f.read_text())
send_result(corr, result) # bus / webhook / queue
f.unlink(missing_ok=True)
for m in sorted(PENDING_DIR.glob("*.running")):
if now - m.stat().st_mtime > TIMEOUT:
send_result(corr, {"success": False, "error": "worker died"})
m.unlink(missing_ok=True)
.running markers (worker died without writing) become explicit
timeout error results — never permanent silence.A tick that ALSO runs its own health doctor will catch the worker's mid-deploy
state (checksum mismatches, files half-rewritten) and fire false FAIL alerts.
Skip the health check while any .running marker exists.
sys.path before importing the parent module
(sys.path.insert(0, str(Path(handler_path).parent))) — cron children don't
inherit PYTHONPATH.importlib.util.spec_from_file_location)
and call its existing process function — don't duplicate the logic.Popen raises, fall through to the legacy
synchronous path rather than dropping the request.agent-message-handler.py UPDATE_REQUEST branch (commit 282045ec,
2026-08-18): _spawn_update_worker() / _send_pending_update_results() /
_update_worker_code() in ops/scripts/agent/agent-message-handler.py,
state/pending-update-results/ under CORTEX_DEPLOY_HOME. Tested end-to-end:
worker → sweep → result received; worker-death (stale marker) → timeout result;
mid-deploy health-doctor skip (killed a false 9-fail alert).