Skip to content

feat: add run SSE events#397

Merged
spboyer merged 2 commits into
mainfrom
spboyer-squad-178-platform-sse-live-events
Jun 30, 2026
Merged

feat: add run SSE events#397
spboyer merged 2 commits into
mainfrom
spboyer-squad-178-platform-sse-live-events

Conversation

@spboyer

@spboyer spboyer commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Add /api/v1/runs/{runId}/events Server-Sent Events stream with sequenced replay and Last-Event-ID/lastEventId recovery support
  • Preserve legacy /api/events by replaying the newest run in the same SSE format
  • Wire Live View to the per-run SSE stream and cover it with a Playwright integration test
  • Document the Live View SSE endpoint and event schema

Closes #178

⚠️ This task was flagged as "needs review" — please have a squad member review before merging.

Validation

  • go test ./...
  • npm run build in web/
  • npx playwright test e2e/live-view.spec.ts --project=chromium in web/
  • npm run build in site/
  • golangci-lint run ./internal/webapi ./internal/webserver

Note: make lint currently fails on stale paths from a different local worktree (../spboyer-glowing-goggles), while the changed Go packages lint cleanly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 30, 2026 13:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a run-scoped Server-Sent Events (SSE) API for streaming (and replaying) run progress events, updates the dashboard Live View to consume the per-run SSE endpoint, adds a Playwright integration test for Live View, and documents the SSE endpoint/event schema.

Changes:

  • Add /api/v1/runs/{runId}/events SSE replay endpoint (plus legacy /api/events mapped to newest run) and event generation helpers.
  • Update the dashboard Live View SSE hook/UI to understand the new event types and connect to the per-run endpoint.
  • Add Playwright coverage for Live View and document the SSE endpoint/schema in the dashboard guide.
Show a summary per file
File Description
web/src/hooks/useSSE.ts Switch Live View to fetch the latest run id and connect to the per-run SSE endpoint; add handling for new event types.
web/src/components/LiveView.tsx Render badges/descriptions for the new run/task/step event types.
web/e2e/live-view.spec.ts Add Playwright test that mocks EventSource and validates Live View rendering.
site/src/content/docs/guides/dashboard.mdx Document the new per-run SSE endpoint, replay semantics, and event schema/types.
internal/webapi/handlers.go Add SSE routes/handlers for per-run events and legacy /api/events; update CORS to allow Last-Event-ID.
internal/webapi/events.go Define SSE event schema, replay filtering via Last-Event-ID/lastEventId, and SSE write helpers.
internal/webapi/events_test.go Add unit tests for event sequencing, replay filtering, legacy endpoint behavior, and concurrent clients.

Review details

  • Files reviewed: 7/7 changed files
  • Comments generated: 8
  • Review effort level: Low

Comment thread web/src/hooks/useSSE.ts
Comment thread web/src/hooks/useSSE.ts
Comment thread web/src/hooks/useSSE.ts Outdated
Comment thread web/src/hooks/useSSE.ts
Comment thread internal/webapi/handlers.go Outdated
Comment thread internal/webapi/handlers.go
Comment thread web/e2e/live-view.spec.ts
Comment thread web/e2e/live-view.spec.ts
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@spboyer spboyer merged commit e733988 into main Jun 30, 2026
9 checks passed
@spboyer spboyer deleted the spboyer-squad-178-platform-sse-live-events branch June 30, 2026 14:30
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.

Platform: SSE live events during run execution

3 participants