Skip to content
This repository was archived by the owner on Aug 11, 2026. It is now read-only.
This repository was archived by the owner on Aug 11, 2026. It is now read-only.

PENDING: feat(hermes-agent): add authenticated Hermes client, readiness checks, and health collector #672

Description

@ahliweb

Parent epic: #668
Depends on: #670, #671

Context

Hermes exposes documented /health, /health/detailed, /v1/models, and OpenAI-compatible API surfaces. AWCMS-Mini needs a bounded server-side adapter and cannot trust arbitrary tenant-provided URLs.

Objective

Implement the authenticated Hermes client, safe endpoint verification, health snapshot collection, and module readiness signals.

Scope

  • Add a HermesProvider/client port and Bun-native HTTP adapter.
  • Resolve API_SERVER_KEY through a server-side secret-reference resolver; raw keys never enter PostgreSQL, browser JavaScript, logs, or audit.
  • Probe:
    • GET /health;
    • authenticated GET /health/detailed;
    • authenticated GET /v1/models where supported.
  • Add awcms_mini_hermes_health_snapshots with bounded, allowlisted fields only.
  • Add on-demand endpoint:
    • POST /api/v1/hermes/agents/{agentId}/health/check
  • Add read endpoints for latest/history health.
  • Add scheduled job bun run hermes:health:collect.
  • Add module-management provider-health/readiness signal.
  • Report configured model vs live-advertised model without silently changing configuration.
  • Normalize unreachable, unauthorized, model-mismatch, degraded, timeout, invalid-response, and healthy states.

SSRF and transport requirements

  • Parse with URL; reject credentials, fragments, unexpected paths, and unsupported schemes.
  • Exact hostname/origin allowlist; no arbitrary redirect following.
  • Protect against DNS rebinding and metadata/link-local/loopback targets unless explicitly declared as a trusted internal endpoint by deployment configuration.
  • Production external endpoints require HTTPS.
  • Internal HTTP is allowed only for an explicitly trusted internal network/origin configured by the operator.
  • Enforce connection/read timeout, response-size limit, bounded retry with jitter, circuit breaker, and concurrency/backpressure.
  • Do not return upstream bodies, stack traces, or authorization details.

Acceptance criteria

  • Healthy, degraded, unreachable, unauthorized, timeout, and model-mismatch states are deterministic.
  • Detailed health fields are allowlisted and size-bounded.
  • Server key is resolved only server-side.
  • SSRF tests cover localhost, metadata IPs, link-local/private policy, redirects, userinfo, DNS changes, and oversized responses.
  • Collector isolates failure per agent and is safe to rerun.
  • Health snapshots are tenant-scoped and retention-ready.
  • Live model check recognizes configured mimo-v2.5-pro when advertised.
  • Audit contains safe status/error codes only.
  • OpenAPI/AsyncAPI, jobs descriptor, docs, and tests are updated.
  • A changeset is added.
  • bun run check passes.

Out of scope

  • Container start/stop/restart.
  • Hermes session-history enumeration.
  • Reading Hermes logs or state files.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions