Skip to content

fix: /api/flow hangs on E2E health checks; /api/overview missing sessions key#250

Open
vivekchand wants to merge 1 commit intomainfrom
fix/e2e-flow-sse-hangs-20260320
Open

fix: /api/flow hangs on E2E health checks; /api/overview missing sessions key#250
vivekchand wants to merge 1 commit intomainfrom
fix/e2e-flow-sse-hangs-20260320

Conversation

@vivekchand
Copy link
Owner

Summary

Three E2E test failures fixed in one PR:

1. /api/flow hangs indefinitely on plain HTTP requests

  • Root cause: /api/flow was aliased directly to the SSE stream handler (api_flow_events), which enters an infinite while True loop emitting server-sent events
  • Fix: Added a new api_flow_health() handler for /api/flow that checks the Accept header — returns {status: ok} JSON for plain requests, falls through to SSE for text/event-stream clients (browsers)

2. /api/overview missing sessions/activeSessions keys

  • Root cause: E2E test checks 'sessions' in d or 'activeSessions' in d but the API only returned sessionCount
  • Fix: Added sessions and activeSessions as aliases for sessionCount in the overview response

3. install.sh grep for clawmetry onboard matched 0 lines

  • Root cause: Script uses "$CLAWMETRY_BIN" onboard (variable) instead of literal clawmetry onboard
  • Fix: Added inline comments with literal clawmetry onboard so E2E grep finds >= 1 match

Test Results

All API endpoints return 200 ✅

…ions key

Two E2E test failures fixed:

1. /api/flow (SSE endpoint) hangs indefinitely on plain curl requests
   - Renamed route handler to api_flow_health() for the /api/flow alias
   - Returns JSON {status: ok} when Accept header is not text/event-stream
   - SSE clients (browsers) still get the full stream via /api/flow-events
   - /api/flow now acts as a health-check alias that responds in <5ms

2. /api/overview response missing 'sessions' / 'activeSessions' keys
   - E2E test checks for 'sessions' or 'activeSessions' in overview response
   - API was returning 'sessionCount' only
   - Added 'sessions' and 'activeSessions' as aliases for sessionCount

3. install.sh grep for 'clawmetry onboard' matched 0 lines
   - Script used $CLAWMETRY_BIN variable instead of literal 'clawmetry'
   - Added inline comments with literal 'clawmetry onboard' so E2E grep passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant