用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lukemcqueen/hermes-cortex --skill bus-archive-diagnostics命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Cross-server agent health monitoring using binary status vectors — deploy health endpoints on each agent, poll from orchestrator, alert on state transitions.
Wire a self-hosted Langfuse instance to Hermes Agent — generate API keys, configure env vars, enable the bundled plugin, install SDK, and verify traces flow.
Use before enforcement code changes or shared-repo commits.
正在显示 SKILL.md
| name | bus-archive-diagnostics |
| description | Query bus queues and archives reliably for fleet results. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| platforms | ["linux","macos"] |
| metadata | {"hermes":{"tags":["bus","pgmq","archives","diagnostics","sql","fleet","verification"],"related_skills":["fleet-commands","cortex-bus","mcp-health-monitoring"]}} |
Reliable read-side queries against the Agent Bus PGMQ store — the patterns for
peeking queues, extracting result payloads, and verifying fleet command
outcomes without hitting the two silent traps that waste queries: the
double-encoded body column and raw-string rows that crash unguarded casts.
bus.messages / bus.archives via psql (docker exec into
mycortex-postgres)body is double-encoded. The envelope object's body field is a JSON
string, not an object. ->'body' yields a jsonb string node — any
->>'field' on it returns NULL silently. Correct extraction:
((body::jsonb #>> '{}')::jsonb->>'body')::jsonb->>'success'
(unwrap to text with ->>'body', then ::jsonb parses, then read fields).body is a bare string (e.g. a literal PING). The double-parse
(body::jsonb #>> '{}')::jsonb on such a row throws
invalid input syntax for type json: Token "PING" and kills the whole
query. Always put jsonb_typeof(body::jsonb)='object' as the FIRST WHERE
clause — AND short-circuits left-to-right per row, so the guard prevents
the cast from ever evaluating on non-object rows.-- UPDATE_RESULTs from the last N minutes (correct inner-body extraction):
SELECT archived_at::timestamptz(0),
(body::jsonb #>> '{}')::jsonb->>'correlation_id',
COALESCE(((body::jsonb #>> '{}')::jsonb->>'body')::jsonb->>'success',''),
COALESCE(((body::jsonb #>> '{}')::jsonb->>'body')::jsonb->>'git_sha_after','')
FROM bus.archives
WHERE jsonb_typeof(body::jsonb)='object' -- guard FIRST
AND (body::jsonb #>> '{}')::jsonb->>'subject'='UPDATE_RESULT'
AND archived_at > NOW() - INTERVAL '30 minutes'
ORDER BY archived_at;
-- Live queue state for a correlation batch:
SELECT queue_name, state,
(body::jsonb #>> '{}')::jsonb-
bus.messages
jsonb_typeof(body::jsonb)
(body::jsonb # )::jsonb
queue_name;
psql via docker exec on your own host may hit the local mycortex-postgres
(15432), which is a REPORTS MIRROR, never authoritative — queue state there
can be stale or empty while the live bus (CORTEX_BUS_URL, e.g.
https://host:13004) has the real messages. The hc CLI routes over HTTP to
the ACTIVE bus — use hc inbox <agent> (peek), hc status, hc bus --all
for authoritative reads. (Archives do replicate to the mirror, so archive
queries via psql are generally trustworthy.)
Fleet handlers early-archive the request before processing, so a consumed
UPDATE_REQUEST proves only that it was READ — never that the update ran or
that a result was sent. The UPDATE_RESULT response path has failed silently on
fleet hosts while the updates themselves landed (2026-08-18: 5/5 requests
consumed, 0/5 results, joseph fully updated at the target SHA). Ground
truth when results are missing: hc exec <agent> cortex-doctor.py --quiet
(greps: Repo sync, Deploy sync, Checksum: <changed file>) — the EXEC
round-trip uses a different code path and often works when the UPDATE result
send failed. Deploy sync: deployed commit matches HEAD + a passing checksum
for the shipped file = the update landed, response lost.
hc exec polls ~5 min and can time out right before a result lands — for
slow agents, prefer hc send <agent> EXEC '<json>' --self-tested then poll
archives after ~5.5 min (decoupled pattern).success: false with a doctor dump that shows only ✅ lines =
the doctor exited non-zero on WARNINGS (Overall: WARNING), not a failed run.exit=1 with empty stderr from a fleet update is the known
"soft success" (needs_update() returns 1 for unchanged files) — check
git_sha_after == target_sha, not the exit code.bus.messages (live) and bus.archives — results are
consumed+archived by the orchestrator's own handler within minutes.