Commit Graph

1 Commits

Author SHA1 Message Date
HonzysClawdbot 2fe7785433
test: add gateway health history e2e + utility unit tests
* fix: show all agents in command select, disable those without active session

Previously the agent select in the OrchestrationBar only listed agents
with a session_key set (agents.filter(a => a.session_key)), causing the
dropdown to appear completely empty when agents exist but none have an
active session. This was confusing — users thought no agents were
registered.

Fix: show all registered agents in the dropdown. Agents without an
active session_key are shown as disabled with a '— no session' suffix
and a tooltip explaining why they can't be messaged. The 'No agents
registered' placeholder is shown only when the agents array is truly
empty.

The send button remains correctly disabled when no valid agent is
selected.

Fixes #321

* test: add gateway health history e2e + utility unit tests

- Add tests/gateway-health-history.spec.ts: Playwright e2e tests for
  GET /api/gateways/health/history and POST /api/gateways/health
  covering auth guards, response shape validation, chronological
  ordering, and gateway name resolution.

- Add src/app/api/gateways/health/health-utils.test.ts: 30 vitest
  unit tests for the pure utility functions in the health probe route:
  ipv4InCidr, isBlockedUrl (SSRF protection), buildGatewayProbeUrl,
  parseGatewayVersion, and hasOpenClaw32ToolsProfileRisk.

All 30 unit tests pass. Covers the health history feature introduced
in feat(gateways): add health history logging and timeline (#300).
2026-03-14 16:39:02 +07:00