Files
hermes-web-ui/packages
ekko 6e5f15fd66 fix(sse): use Authorization header instead of query token for EventSource (#318)
* fix(sse): use Authorization header instead of query token for EventSource

Fixes #315 - EventSource connection lost when Hermes Gateway requires Bearer token authentication.

Problem:
- Web UI used `?token=<query>` for SSE event streaming
- Hermes Gateway expects `Authorization: Bearer <token>` header (like other API endpoints)
- Mismatch caused 'EventSource connection lost' errors on longer runs

Solution:
- Use eventsource library's `fetch` override to pass Authorization header
- Apply fix to all 4 EventSource usage points:
  1. chat-run-socket.ts - main chat run events
  2. group-chat/agent-clients.ts - agent run events
  3. context-compressor/index.ts - compression events
  4. context-engine/gateway-client.ts - context engine events

Benefits:
- Consistent authentication across all API endpoints
- Better compatibility with Hermes Gateway
- Fixes SSE stream disconnections

Note: Added @ts-ignore comments because eventsource library types are stricter than actual fetch API capabilities.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: bump version to 0.5.2

Includes fix for EventSource Authorization header (issue #315)

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-29 23:09:18 +08:00
..