Skip to content

Plan to add external events plan#217

Open
archandatta wants to merge 1 commit intomainfrom
archand/plan/externel-events-stream
Open

Plan to add external events plan#217
archandatta wants to merge 1 commit intomainfrom
archand/plan/externel-events-stream

Conversation

@archandatta
Copy link
Copy Markdown
Contributor

@archandatta archandatta commented Apr 14, 2026

Note

Low Risk
Documentation-only change with no runtime/code behavior impact.

Overview
Adds plans/external-events.md, a detailed implementation plan for two proposed endpoints on CaptureSession: POST /events/capture_session/publish for external event ingestion (with validation/defaulting semantics) and GET /events/capture_session/stream for SSE streaming (including Last-Event-ID resume behavior and response headers).

Reviewed by Cursor Bugbot for commit fc419d0. Bugbot is set up for automated code reviews on this repo. Configure here.

@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR title and empty body provide insufficient information to determine if kernel API endpoints or Temporal workflows are being modified; please add details about what files are changed.

To monitor this PR anyway, reply with @firetiger monitor this.

@archandatta archandatta force-pushed the archand/plan/externel-events-stream branch from a19154d to fc419d0 Compare April 14, 2026 17:24
@archandatta archandatta requested review from Sayan- and rgarcia April 14, 2026 17:25
@@ -0,0 +1,155 @@
# External Event Ingestion + SSE Streaming — Plan

**Scope:** Two new HTTP endpoints layered on top of the merged CDP base: `POST /events/capture_session/publish` (external event ingestion) and `GET /events/capture_session/stream` (SSE live stream), both wired into the existing resource-style `CaptureSession`.
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.

i don't think the url here should be nested under capture_session. in my mind the capture session is a singleton producer the API runs / users can configure that publishes to a shared event stream that others can publish into. it doesn't own this stream

so either POST /events or POST /events/publish and GET /events or GET /evenst/stream makes more sense to me

| Method | Path | Handler | operationId |
| --- | --- | --- | --- |
| POST | `/events/capture_session/publish` | `ApiService.PublishEvent` | `publishEvent` |
| GET | `/events/capture_session/stream` | `ApiService.StreamCaptureSession` (SSE) | `streamCaptureSession` |
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.

the event stream is independent from the concept of capture session, so i would rename this to just StreamEvents or something

| POST | `/events/capture_session/publish` | `ApiService.PublishEvent` | `publishEvent` |
| GET | `/events/capture_session/stream` | `ApiService.StreamCaptureSession` (SSE) | `streamCaptureSession` |

The stream endpoint follows the same singleton pattern as the other `/events/capture_session` routes. Handlers reference `s.captureSession` directly; the endpoint returns 404 when no session is active.
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.

i don't think the stream endpoint should be stateful or a singleton. Many API users should be able to call this and request events starting after some time or sequence number. It's not tied to capture session, in fact capture session might not even be running

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.

2 participants