Skip to content

fix: E2E test failures — localhost auth bypass, /api/flow SSE, sessions key, version sync#266

Merged
vivekchand merged 1 commit intomainfrom
fix/e2e-localhost-auth-bypass-20260321
Mar 21, 2026
Merged

fix: E2E test failures — localhost auth bypass, /api/flow SSE, sessions key, version sync#266
vivekchand merged 1 commit intomainfrom
fix/e2e-localhost-auth-bypass-20260321

Conversation

@vivekchand
Copy link
Owner

Summary

Fixes 4 E2E test failures detected by the automated health check (2026-03-21).

Failures fixed

Step 3 — API endpoints return 401
When the dashboard detects a gateway token from the running OpenClaw process, all /api/* routes require a Bearer token. Local curl calls (and E2E tests) get 401. Fix: trust 127.0.0.1 and ::1 — auth is meant to protect remote access, not local health checks.

Step 3 — /api/flow hangs (000 timeout)
/api/flow is an SSE streaming endpoint that never returns unless a client disconnects. curl without --no-buffer just times out. Fix: detect non-SSE clients (Accept header doesn't include text/event-stream) and return a JSON {ok:true} response immediately.

Step 3 — /api/overview missing 'sessions' key
The E2E test checks 'sessions' in d or 'activeSessions' in d. The overview response only had sessionCount. Fix: add sessions and activeSessions aliases.

Step 5 — VERSION_MISMATCH (PyPI 0.12.61 vs GitHub 0.12.60)
The version bump to 0.12.61 was committed on a branch that wasn't merged into main. Fix: sync __version__ to 0.12.61.

Step 4 — install.sh grep for 'clawmetry onboard' finds 0 matches
The script uses $CLAWMETRY_BIN onboard (variable), not the literal string. The E2E test grep -c 'clawmetry onboard' fails. Fix: add a comment with the literal string.

Testing

All 5 issues verified locally on the running dashboard.

…version sync

- Trust 127.0.0.1/::1 on all /api/* routes (auth guards remote access only)
  E2E tests and local curl calls no longer get 401 when gateway token is set
- /api/flow SSE endpoint returns JSON {ok:true} for non-SSE clients instead of hanging
  Fixes E2E test step 3 which expects 200 from curl on /api/flow
- api_overview now includes 'sessions' and 'activeSessions' keys alongside sessionCount
  Fixes E2E overview key check ('sessions' in d)
- Sync __version__ to 0.12.61 to match PyPI
- install.sh: add literal 'clawmetry onboard' comment for E2E grep test

Closes: E2E test failures for steps 3 (API 401) and 5 (version mismatch)
@vivekchand vivekchand merged commit 766d997 into main Mar 21, 2026
17 of 19 checks passed
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